diff options
author | Mattes D <github@xoft.cz> | 2014-10-24 09:13:39 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-24 09:13:39 +0200 |
commit | 190d34e2f7faf4889f097853872afc51499077ad (patch) | |
tree | ac92559e9b37492c4b0225fd7aa9972a0db4702e | |
parent | OSSupport/CMakeLists.txt: fixed indentation (diff) | |
parent | IniFile: Removed the problematic printf-like Set function. (diff) | |
download | cuberite-190d34e2f7faf4889f097853872afc51499077ad.tar cuberite-190d34e2f7faf4889f097853872afc51499077ad.tar.gz cuberite-190d34e2f7faf4889f097853872afc51499077ad.tar.bz2 cuberite-190d34e2f7faf4889f097853872afc51499077ad.tar.lz cuberite-190d34e2f7faf4889f097853872afc51499077ad.tar.xz cuberite-190d34e2f7faf4889f097853872afc51499077ad.tar.zst cuberite-190d34e2f7faf4889f097853872afc51499077ad.zip |
35 files changed, 36 insertions, 71 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 188cf81e3..66281fe0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,6 @@ set(SQLITECPP_BUILD_TESTS OFF CACHE BOOL "Build and run tests." set(SQLITECPP_INTERNAL_SQLITE OFF CACHE BOOL "Add the internal SQLite3 source to the project." FORCE) # Include all the libraries: -add_subdirectory(lib/inifile/) add_subdirectory(lib/jsoncpp/) add_subdirectory(lib/zlib/) add_subdirectory(lib/lua/) diff --git a/Tools/QtBiomeVisualiser/ChunkSource.cpp b/Tools/QtBiomeVisualiser/ChunkSource.cpp index 3e5216458..c5cde1c3b 100644 --- a/Tools/QtBiomeVisualiser/ChunkSource.cpp +++ b/Tools/QtBiomeVisualiser/ChunkSource.cpp @@ -4,7 +4,7 @@ #include "src/Generating/BioGen.h" #include "src/StringCompression.h" #include "src/WorldStorage/FastNBT.h" -#include "inifile/iniFile.h" +#include "src/IniFile.h" diff --git a/Tools/QtBiomeVisualiser/GeneratorSetup.cpp b/Tools/QtBiomeVisualiser/GeneratorSetup.cpp index 7d94a1682..a6490d9fe 100644 --- a/Tools/QtBiomeVisualiser/GeneratorSetup.cpp +++ b/Tools/QtBiomeVisualiser/GeneratorSetup.cpp @@ -3,7 +3,7 @@ #include <QLabel> #include <QLineEdit> #include "src/Generating/BioGen.h" -#include "inifile/iniFile.h" +#include "src/IniFile.h" diff --git a/Tools/QtBiomeVisualiser/MainWindow.cpp b/Tools/QtBiomeVisualiser/MainWindow.cpp index 63d72f992..7853d768e 100644 --- a/Tools/QtBiomeVisualiser/MainWindow.cpp +++ b/Tools/QtBiomeVisualiser/MainWindow.cpp @@ -8,7 +8,7 @@ #include <QSettings> #include <QDirIterator> #include <QStatusBar> -#include "inifile/iniFile.h" +#include "src/IniFile.h" #include "ChunkSource.h" #include "src/Generating/BioGen.h" #include "src/StringCompression.h" diff --git a/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro index 9e5d1303c..f3a5255fb 100644 --- a/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro +++ b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro @@ -21,7 +21,7 @@ SOURCES +=\ ../../src/StringUtils.cpp \ ../../src/LoggerListeners.cpp \ ../../src/Logger.cpp \ - ../../lib/inifile/iniFile.cpp \ + ../../src/IniFile.cpp \ ../../src/OSSupport/File.cpp \ ../../src/OSSupport/CriticalSection.cpp \ ../../src/OSSupport/IsThread.cpp \ @@ -59,7 +59,7 @@ HEADERS += MainWindow.h \ ../../src/StringUtils.h \ ../../src/LoggerListeners.h \ ../../src/Logger.h \ - ../../lib/inifile/iniFile.h \ + ../../src/IniFile.h \ ../../src/OSSupport/File.h \ ../../src/OSSupport/CriticalSection.h \ ../../src/OSSupport/IsThread.h \ diff --git a/lib/inifile/CMakeLists.txt b/lib/inifile/CMakeLists.txt deleted file mode 100644 index 321d501d7..000000000 --- a/lib/inifile/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required (VERSION 2.6) -project (iniFile) - -include_directories ("${PROJECT_SOURCE_DIR}/../../src/") - -file(GLOB SOURCE - "*.h" - "*.cpp" -) - -add_library(iniFile ${SOURCE}) diff --git a/src/Bindings/AllToLua.pkg b/src/Bindings/AllToLua.pkg index 1bff26b0e..7b78578ee 100644 --- a/src/Bindings/AllToLua.pkg +++ b/src/Bindings/AllToLua.pkg @@ -15,7 +15,7 @@ $cfile "../Vector3.h" $cfile "../ChunkDef.h" $cfile "../BiomeDef.h" -$cfile "../../lib/inifile/iniFile.h" +$cfile "../IniFile.h" $cfile "../OSSupport/File.h" diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index e549aefa3..f63578885 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -9,7 +9,7 @@ #include "../Server.h" #include "../CommandOutput.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "../Entities/Player.h" #define FIND_HOOK(a_HookName) HookMap::iterator Plugins = m_Hooks.find(a_HookName); diff --git a/src/BlockID.cpp b/src/BlockID.cpp index 755c721db..c0f3193bb 100644 --- a/src/BlockID.cpp +++ b/src/BlockID.cpp @@ -4,7 +4,7 @@ #include "Globals.h" #include "BlockID.h" -#include "inifile/iniFile.h" +#include "IniFile.h" #include "Item.h" #include "Mobs/Monster.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d0e2cede..096fa824d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,6 +34,7 @@ SET (SRCS FastRandom.cpp FurnaceRecipe.cpp Globals.cpp + IniFile.cpp Inventory.cpp Item.cpp ItemGrid.cpp @@ -98,6 +99,7 @@ SET (HDRS ForEachChunkProvider.h FurnaceRecipe.h Globals.h + IniFile.h Inventory.h Item.h ItemGrid.h @@ -320,4 +322,4 @@ endif () if (WIN32) target_link_libraries(${EXECUTABLE} expat tolualib ws2_32.lib Psapi.lib) endif() -target_link_libraries(${EXECUTABLE} luaexpat iniFile jsoncpp polarssl zlib sqlite lua SQLiteCpp) +target_link_libraries(${EXECUTABLE} luaexpat jsoncpp polarssl zlib sqlite lua SQLiteCpp) diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index d4677c038..5c18d8f96 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -20,7 +20,7 @@ #include "../WorldStorage/StatSerializer.h" #include "../CompositeChat.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "json/json.h" // 6000 ticks or 5 minutes diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index d86d44bbc..203faff56 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -5,7 +5,7 @@ #include "Globals.h" #include "BioGen.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "../LinearUpscale.h" diff --git a/src/Generating/CMakeLists.txt b/src/Generating/CMakeLists.txt index 33d622b42..cd3d5a9f3 100644 --- a/src/Generating/CMakeLists.txt +++ b/src/Generating/CMakeLists.txt @@ -65,5 +65,5 @@ SET (HDRS if(NOT MSVC) add_library(Generating ${SRCS} ${HDRS}) - target_link_libraries(Generating OSSupport iniFile Blocks) + target_link_libraries(Generating OSSupport Blocks) endif() diff --git a/src/Generating/ChunkGenerator.cpp b/src/Generating/ChunkGenerator.cpp index 1eecd6e51..92e1bb31d 100644 --- a/src/Generating/ChunkGenerator.cpp +++ b/src/Generating/ChunkGenerator.cpp @@ -2,7 +2,7 @@ #include "Globals.h" #include "ChunkGenerator.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "ChunkDesc.h" #include "ComposableGenerator.h" #include "Noise3DGenerator.h" diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 2c88f23f1..29b831dfd 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -12,7 +12,7 @@ #include "../BlockID.h" #include "../Item.h" #include "../LinearUpscale.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp index 9a52588d5..169821050 100644 --- a/src/Generating/ComposableGenerator.cpp +++ b/src/Generating/ComposableGenerator.cpp @@ -7,7 +7,7 @@ #include "ComposableGenerator.h" #include "../World.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "../Root.h" // Individual composed algorithms: diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp index e6849fadf..aac1d2bf3 100644 --- a/src/Generating/DistortedHeightmap.cpp +++ b/src/Generating/DistortedHeightmap.cpp @@ -7,7 +7,7 @@ #include "DistortedHeightmap.h" #include "../OSSupport/File.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "../LinearUpscale.h" diff --git a/src/Generating/EndGen.cpp b/src/Generating/EndGen.cpp index c94cd1eff..0111d2fa3 100644 --- a/src/Generating/EndGen.cpp +++ b/src/Generating/EndGen.cpp @@ -5,7 +5,7 @@ #include "Globals.h" #include "EndGen.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "../LinearUpscale.h" diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index 96e3dc26b..0564789dc 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -15,7 +15,7 @@ #include "../Simulator/FluidSimulator.h" // for cFluidSimulator::CanWashAway() #include "../Simulator/FireSimulator.h" #include "../World.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" diff --git a/src/Generating/HeiGen.cpp b/src/Generating/HeiGen.cpp index acfefaefc..a0b8770f5 100644 --- a/src/Generating/HeiGen.cpp +++ b/src/Generating/HeiGen.cpp @@ -6,7 +6,7 @@ #include "Globals.h" #include "HeiGen.h" #include "../LinearUpscale.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "DistortedHeightmap.h" #include "EndGen.h" #include "Noise3DGenerator.h" diff --git a/src/Generating/Noise3DGenerator.cpp b/src/Generating/Noise3DGenerator.cpp index c3ca30384..5a4cb44cf 100644 --- a/src/Generating/Noise3DGenerator.cpp +++ b/src/Generating/Noise3DGenerator.cpp @@ -6,7 +6,7 @@ #include "Globals.h" #include "Noise3DGenerator.h" #include "../OSSupport/File.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "../LinearInterpolation.h" #include "../LinearUpscale.h" diff --git a/src/Generating/Prefabs/CMakeLists.txt b/src/Generating/Prefabs/CMakeLists.txt index 2c62aa73d..68f6491c4 100644 --- a/src/Generating/Prefabs/CMakeLists.txt +++ b/src/Generating/Prefabs/CMakeLists.txt @@ -29,5 +29,5 @@ SET (HDRS if(NOT MSVC) add_library(Generating_Prefabs ${SRCS} ${HDRS}) - target_link_libraries(Generating_Prefabs OSSupport iniFile Blocks) + target_link_libraries(Generating_Prefabs OSSupport Blocks) endif() diff --git a/src/HTTPServer/HTTPServer.h b/src/HTTPServer/HTTPServer.h index 522b7da62..73d4cbdd0 100644 --- a/src/HTTPServer/HTTPServer.h +++ b/src/HTTPServer/HTTPServer.h @@ -11,7 +11,7 @@ #include "../OSSupport/ListenThread.h" #include "../OSSupport/SocketThreads.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "PolarSSL++/RsaPrivateKey.h" #include "PolarSSL++/CryptoKey.h" #include "PolarSSL++/X509Cert.h" diff --git a/lib/inifile/iniFile.cpp b/src/IniFile.cpp index 7cfe7661f..a666a4ff8 100644 --- a/lib/inifile/iniFile.cpp +++ b/src/IniFile.cpp @@ -24,7 +24,7 @@ #include <ctype.h> // Local Includes -#include "iniFile.h" +#include "IniFile.h" #if defined(WIN32) #define iniEOL endl @@ -32,10 +32,6 @@ #define iniEOL '\r' << endl #endif -#ifndef _WIN32 - #define sscanf_s(buffer, stringbuffer, ...) (sscanf(buffer, stringbuffer, __VA_ARGS__)) -#endif - using namespace std; @@ -465,20 +461,6 @@ bool cIniFile::SetValueF(const AString & a_KeyName, const AString & a_ValueName, -bool cIniFile::SetValueV(const AString & a_KeyName, const AString & a_ValueName, const char * a_Format, ...) -{ - va_list args; - va_start(args, a_Format); - AString Data; - AppendVPrintf(Data, a_Format, args); - va_end(args); - return SetValue(a_KeyName, a_ValueName, Data); -} - - - - - AString cIniFile::GetValue(const int keyID, const int valueID, const AString & defValue) const { if ((keyID < (int)keys.size()) && (valueID < (int)keys[keyID].names.size())) diff --git a/lib/inifile/iniFile.h b/src/IniFile.h index 33229bff0..3f704551f 100644 --- a/lib/inifile/iniFile.h +++ b/src/IniFile.h @@ -154,12 +154,6 @@ public: } bool SetValueF(const AString & a_KeyName, const AString & a_ValueName, const double a_Value, const bool a_CreateIfNotExists = true); - // tolua_end - - bool SetValueV( const AString & a_KeyName, const AString & a_ValueName, const char * a_Format, ...); - - // tolua_begin - // Deletes specified value. // Returns true if value existed and deleted, false otherwise. bool DeleteValueByID(const int keyID, const int valueID); diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp index a15e413ba..ae2cbbc6b 100644 --- a/src/MonsterConfig.cpp +++ b/src/MonsterConfig.cpp @@ -3,7 +3,7 @@ #include "MonsterConfig.h" #include "Mobs/Monster.h" -#include "inifile/iniFile.h" +#include "IniFile.h" diff --git a/src/Protocol/Authenticator.cpp b/src/Protocol/Authenticator.cpp index 984000795..c9e4296a2 100644 --- a/src/Protocol/Authenticator.cpp +++ b/src/Protocol/Authenticator.cpp @@ -7,7 +7,7 @@ #include "../Server.h" #include "../ClientHandle.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "json/json.h" #include "PolarSSL++/BlockingSslClientSocket.h" diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp index dd0d62af5..67f513e44 100644 --- a/src/Protocol/MojangAPI.cpp +++ b/src/Protocol/MojangAPI.cpp @@ -7,7 +7,7 @@ #include "MojangAPI.h" #include "SQLiteCpp/Database.h" #include "SQLiteCpp/Statement.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" #include "json/json.h" #include "PolarSSL++/BlockingSslClientSocket.h" #include "../RankManager.h" diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp index df027c91f..49ca4fc61 100644 --- a/src/RCONServer.cpp +++ b/src/RCONServer.cpp @@ -4,7 +4,7 @@ // Implements the cRCONServer class representing the RCON server #include "Globals.h" -#include "inifile/iniFile.h" +#include "IniFile.h" #include "RCONServer.h" #include "Server.h" #include "Root.h" diff --git a/src/RankManager.cpp b/src/RankManager.cpp index 3778f5d64..451de88e7 100644 --- a/src/RankManager.cpp +++ b/src/RankManager.cpp @@ -5,7 +5,7 @@ #include "Globals.h" #include "RankManager.h" -#include "inifile/iniFile.h" +#include "IniFile.h" #include "Protocol/MojangAPI.h" #include "ClientHandle.h" diff --git a/src/Root.cpp b/src/Root.cpp index 6a91ec238..24c1a4cc8 100644 --- a/src/Root.cpp +++ b/src/Root.cpp @@ -19,11 +19,10 @@ #include "OSSupport/Timer.h" #include "LoggerListeners.h" #include "BuildInfo.h" - -#include "inifile/iniFile.h" +#include "IniFile.h" #ifdef _WIN32 - #include "conio.h" + #include <conio.h> #include <psapi.h> #elif defined(__linux__) #include <fstream> diff --git a/src/Server.cpp b/src/Server.cpp index 5085d4c94..bbb5ecff3 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -22,7 +22,7 @@ #include "MersenneTwister.h" -#include "inifile/iniFile.h" +#include "IniFile.h" #include "Vector3.h" #include <fstream> diff --git a/src/Simulator/SandSimulator.cpp b/src/Simulator/SandSimulator.cpp index 073518b31..dfbd3e458 100644 --- a/src/Simulator/SandSimulator.cpp +++ b/src/Simulator/SandSimulator.cpp @@ -7,7 +7,7 @@ #include "../Defines.h" #include "../Entities/FallingBlock.h" #include "../Chunk.h" -#include "inifile/iniFile.h" +#include "../IniFile.h" diff --git a/src/WebAdmin.h b/src/WebAdmin.h index 94b95dbcf..a85fb1f0c 100644 --- a/src/WebAdmin.h +++ b/src/WebAdmin.h @@ -7,7 +7,7 @@ #include "OSSupport/Socket.h" #include "Bindings/LuaState.h" -#include "inifile/iniFile.h" +#include "IniFile.h" #include "HTTPServer/HTTPServer.h" #include "HTTPServer/HTTPFormParser.h" diff --git a/src/World.cpp b/src/World.cpp index 9b7d54670..2e079d447 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -8,7 +8,7 @@ #include "Server.h" #include "Item.h" #include "Root.h" -#include "inifile/iniFile.h" +#include "IniFile.h" #include "ChunkMap.h" #include "Generating/ChunkDesc.h" #include "OSSupport/Timer.h" |