Renamed "Tutorial" namespace to "ApiWithoutSecrets". Added ApiWithoutSecrets namescape to all files. Placed function pointers in an ApiWithoutSecrets namespace to fix errors on Linux.

This commit is contained in:
plapins
2016-04-13 09:27:27 +02:00
parent d34da4e8e0
commit 95675bd125
20 changed files with 423 additions and 399 deletions

View File

@@ -12,27 +12,31 @@
#include <iostream>
#include "Tools.h"
namespace Tools {
namespace ApiWithoutSecrets {
std::vector<char> GetBinaryFileContents( std::string const &filename ) {
namespace Tools {
std::ifstream file( filename, std::ios::binary );
if( file.fail() ) {
std::cout << "Could not open \"" << filename << "\" file!" << std::endl;
return std::vector<char>();
std::vector<char> GetBinaryFileContents( std::string const &filename ) {
std::ifstream file( filename, std::ios::binary );
if( file.fail() ) {
std::cout << "Could not open \"" << filename << "\" file!" << std::endl;
return std::vector<char>();
}
std::streampos begin, end;
begin = file.tellg();
file.seekg( 0, std::ios::end );
end = file.tellg();
std::vector<char> result( static_cast<size_t>(end - begin) );
file.seekg( 0, std::ios::beg );
file.read( &result[0], end - begin );
file.close();
return result;
}
std::streampos begin, end;
begin = file.tellg();
file.seekg( 0, std::ios::end );
end = file.tellg();
} // namespace Tools
std::vector<char> result( static_cast<size_t>(end - begin) );
file.seekg( 0, std::ios::beg );
file.read( &result[0], end - begin );
file.close();
return result;
}
}
} // namespace ApiWithoutSecrets