Revert "remove implicitly defined inline keywords from header-implemented functions in Util/ headers"

This reverts commit dc35e97ae002bdfda4bc3a68507749c464cfe371.
This commit is contained in:
Dennis Luxen 2014-08-29 11:14:59 +02:00
parent 9b501276fb
commit e938bd3481
8 changed files with 24 additions and 28 deletions

View File

@ -36,6 +36,6 @@ enum CompressionType
gzipRFC1952, gzipRFC1952,
deflateRFC1951 }; deflateRFC1951 };
} // namespace http }
#endif // COMPRESSION_TYPE_H #endif // COMPRESSION_TYPE_H

View File

@ -50,7 +50,7 @@ namespace filesystem
// exists. The validate() function must be defined in the same namespace // exists. The validate() function must be defined in the same namespace
// as the target type, (boost::filesystem::path in this case), otherwise // as the target type, (boost::filesystem::path in this case), otherwise
// it is not called // it is not called
// void validate( // inline void validate(
// boost::any & v, // boost::any & v,
// const std::vector<std::string> & values, // const std::vector<std::string> & values,
// boost::filesystem::path *, // boost::filesystem::path *,
@ -68,7 +68,7 @@ namespace filesystem
// adapted from: // adapted from:
// http://stackoverflow.com/questions/1746136/how-do-i-normalize-a-pathname-using-boostfilesystem // http://stackoverflow.com/questions/1746136/how-do-i-normalize-a-pathname-using-boostfilesystem
boost::filesystem::path inline boost::filesystem::path
portable_canonical(const boost::filesystem::path &relative_path, portable_canonical(const boost::filesystem::path &relative_path,
const boost::filesystem::path &current_path = boost::filesystem::current_path()) const boost::filesystem::path &current_path = boost::filesystem::current_path())
{ {
@ -115,7 +115,7 @@ portable_canonical(const boost::filesystem::path &relative_path,
#if BOOST_FILESYSTEM_VERSION < 3 #if BOOST_FILESYSTEM_VERSION < 3
path temp_directory_path() inline path temp_directory_path()
{ {
char *buffer; char *buffer;
buffer = tmpnam(nullptr); buffer = tmpnam(nullptr);
@ -123,7 +123,7 @@ path temp_directory_path()
return path(buffer); return path(buffer);
} }
path unique_path(const path &) { return temp_directory_path(); } inline path unique_path(const path &) { return temp_directory_path(); }
#endif #endif
} }
@ -133,7 +133,7 @@ path unique_path(const path &) { return temp_directory_path(); }
#define BOOST_FILESYSTEM_VERSION 3 #define BOOST_FILESYSTEM_VERSION 3
#endif #endif
void AssertPathExists(const boost::filesystem::path &path) inline void AssertPathExists(const boost::filesystem::path &path)
{ {
if (!boost::filesystem::is_regular_file(path)) if (!boost::filesystem::is_regular_file(path))
{ {

View File

@ -43,11 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string> #include <string>
// generate boost::program_options object for the routing part // generate boost::program_options object for the routing part
<<<<<<< HEAD
bool GenerateDataStoreOptions(const int argc, const char *argv[], ServerPaths &paths) bool GenerateDataStoreOptions(const int argc, const char *argv[], ServerPaths &paths)
=======
bool GenerateDataStoreOptions(const int argc, const char *argv[], ServerPaths &paths, bool & springclean)
>>>>>>> remove implicitly defined inline keywords from header-implemented functions in Util/ headers
{ {
// declare a group of options that will be allowed only on command line // declare a group of options that will be allowed only on command line
boost::program_options::options_description generic_options("Options"); boost::program_options::options_description generic_options("Options");

View File

@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string> #include <string>
// support old capitalized option names by down-casing them with a regex replace // support old capitalized option names by down-casing them with a regex replace
std::string ReadIniFileAndLowerContents(const boost::filesystem::path &path) inline std::string ReadIniFileAndLowerContents(const boost::filesystem::path &path)
{ {
boost::filesystem::fstream config_stream(path); boost::filesystem::fstream config_stream(path);
std::string ini_file_content((std::istreambuf_iterator<char>(config_stream)), std::string ini_file_content((std::istreambuf_iterator<char>(config_stream)),

View File

@ -43,7 +43,7 @@ extern "C" {
template <typename T> void LUA_print(T output) { std::cout << "[LUA] " << output << std::endl; } template <typename T> void LUA_print(T output) { std::cout << "[LUA] " << output << std::endl; }
// Check if the lua function <name> is defined // Check if the lua function <name> is defined
bool lua_function_exists(lua_State *lua_state, const char *name) inline bool lua_function_exists(lua_State *lua_state, const char *name)
{ {
luabind::object globals_table = luabind::globals(lua_state); luabind::object globals_table = luabind::globals(lua_state);
luabind::object lua_function = globals_table[name]; luabind::object lua_function = globals_table[name];
@ -53,7 +53,7 @@ bool lua_function_exists(lua_State *lua_state, const char *name)
// Add the folder contain the script to the lua load path, so script can easily require() other lua // Add the folder contain the script to the lua load path, so script can easily require() other lua
// scripts inside that folder, or subfolders. // scripts inside that folder, or subfolders.
// See http://lua-users.org/wiki/PackagePath for details on the package.path syntax. // See http://lua-users.org/wiki/PackagePath for details on the package.path syntax.
void luaAddScriptFolderToLoadPath(lua_State *lua_state, const char *file_name) inline void luaAddScriptFolderToLoadPath(lua_State *lua_state, const char *file_name)
{ {
const boost::filesystem::path profile_path(file_name); const boost::filesystem::path profile_path(file_name);
std::string folder = profile_path.parent_path().string(); std::string folder = profile_path.parent_path().string();

View File

@ -144,7 +144,7 @@ inline void populate_base_path(ServerPaths &server_paths)
} }
// generate boost::program_options object for the routing part // generate boost::program_options object for the routing part
unsigned GenerateServerProgramOptions(const int argc, inline unsigned GenerateServerProgramOptions(const int argc,
const char *argv[], const char *argv[],
ServerPaths &paths, ServerPaths &paths,
std::string &ip_address, std::string &ip_address,

View File

@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// precision: position after decimal point // precision: position after decimal point
// length: maximum number of digits including comma and decimals // length: maximum number of digits including comma and decimals
// work with negative values to prevent overflowing when taking -value // work with negative values to prevent overflowing when taking -value
template <int length, int precision> static char *printInt(char *buffer, int value) template <int length, int precision> static inline char *printInt(char *buffer, int value)
{ {
bool minus = true; bool minus = true;
if (value > 0) if (value > 0)
@ -76,7 +76,7 @@ inline void replaceAll(std::string &s, const std::string &sub, const std::string
boost::replace_all(s, sub, other); boost::replace_all(s, sub, other);
} }
std::string EscapeJSONString(const std::string &input) inline std::string EscapeJSONString(const std::string &input)
{ {
std::string output; std::string output;
output.reserve(input.size()); output.reserve(input.size());
@ -120,7 +120,7 @@ static std::string originals[] = {"&", "\"", "<", ">", "'", "[", "]", "\\"};
static std::string entities[] = { static std::string entities[] = {
"&amp;", "&quot;", "&lt;", "&gt;", "&#39;", "&91;", "&93;", " &#92;"}; "&amp;", "&quot;", "&lt;", "&gt;", "&#39;", "&91;", "&93;", " &#92;"};
std::size_t URIDecode(const std::string &input, std::string &output) inline std::size_t URIDecode(const std::string &input, std::string &output)
{ {
auto src_iter = input.begin(); auto src_iter = input.begin();
output.resize(input.size() + 1); output.resize(input.size() + 1);
@ -144,7 +144,7 @@ std::size_t URIDecode(const std::string &input, std::string &output)
return decoded_length; return decoded_length;
} }
std::size_t URIDecodeInPlace(std::string &URI) { return URIDecode(URI, URI); } inline std::size_t URIDecodeInPlace(std::string &URI) { return URIDecode(URI, URI); }
// TODO: remove after switch to libosmium // TODO: remove after switch to libosmium
inline bool StringStartsWith(const std::string &input, const std::string &prefix) inline bool StringStartsWith(const std::string &input, const std::string &prefix)
@ -152,7 +152,7 @@ inline bool StringStartsWith(const std::string &input, const std::string &prefix
return boost::starts_with(input, prefix); return boost::starts_with(input, prefix);
} }
std::string GetRandomString() inline std::string GetRandomString()
{ {
std::string s; std::string s;
s.resize(128); s.resize(128);

View File

@ -41,13 +41,13 @@ template <typename T> void sort_unique_resize(std::vector<T> &vector)
vector.resize(number_of_unique_elements); vector.resize(number_of_unique_elements);
} }
// template <typename T> void sort_unique_resize_shrink_vector(std::vector<T> &vector) // template <typename T> inline void sort_unique_resize_shrink_vector(std::vector<T> &vector)
// { // {
// sort_unique_resize(vector); // sort_unique_resize(vector);
// vector.shrink_to_fit(); // vector.shrink_to_fit();
// } // }
// template <typename T> void remove_consecutive_duplicates_from_vector(std::vector<T> &vector) // template <typename T> inline void remove_consecutive_duplicates_from_vector(std::vector<T> &vector)
// { // {
// const auto number_of_unique_elements = std::unique(vector.begin(), vector.end()) - vector.begin(); // const auto number_of_unique_elements = std::unique(vector.begin(), vector.end()) - vector.begin();
// vector.resize(number_of_unique_elements); // vector.resize(number_of_unique_elements);