|
1 | | -# LeksysINI |
| 1 | +/===============================================================================================================\ |
| 2 | +| _ _ _ ___ _ _ ___ ____ | |
| 3 | +| | | ___| | _____ _ _ ___( ) |_ _| \ | |_ _| _ \ __ _ _ __ ___ ___ _ __ | |
| 4 | +| | | / _ \ |/ / __| | | / __|/ | || \| || || |_) / _` | '__/ __|/ _ \ '__| | |
| 5 | +| | |__| __/ <\__ \ |_| \__ \ | || |\ || || __/ (_| | | \__ \ __/ | | |
| 6 | +| |_____\___|_|\_\___/\__, |___/ |___|_| \_|___|_| \__,_|_| |___/\___|_| | |
| 7 | +| |___/ | |
| 8 | +| by Borovik Alexey | |
| 9 | +\===============================================================================================================/ |
| 10 | + |
| 11 | +Crossplatform all-in-one INI-file parser, written on C++ with STL |
| 12 | + |
| 13 | +|---------------------------------------------------------------------------------------------------------------| |
| 14 | +| Advantages | |
| 15 | +|---------------------------------------------------------------------------------------------------------------| |
| 16 | + |
| 17 | +• Residents in single file - iniparser.hpp. Simply include it to your project and use |
| 18 | +• Crossplatform (Windows & POSIX) |
| 19 | +• Nice and easy-to-use C++ interface |
| 20 | +• Extends standart INI interface with: |
| 21 | + -> Arrays (comma-separated values) support |
| 22 | + -> Nested sections [parent.child] support |
| 23 | + -> File includes (;#include <file_path>) |
| 24 | +• Can be used to save and load any user-defined classes, as long as stream operators are provided |
| 25 | +• Supports multilines |
| 26 | +• Loads & saves comments |
| 27 | +• MIT license |
| 28 | + |
| 29 | +|---------------------------------------------------------------------------------------------------------------| |
| 30 | +| Usage | |
| 31 | +|---------------------------------------------------------------------------------------------------------------| |
| 32 | + |
| 33 | +Include provided iniparser.hpp to your C++ project and that is all |
| 34 | +Usage information can be found on project's GitHub page |
| 35 | +Look in test_app.cpp for different ways of using Leksys' IniParser |
| 36 | +For testing purposes you can compile provided test application (see next section) |
| 37 | + |
| 38 | +|---------------------------------------------------------------------------------------------------------------| |
| 39 | +| Building Test Application | |
| 40 | +|---------------------------------------------------------------------------------------------------------------| |
| 41 | +You need to install CMake before building test_app |
| 42 | +CMake binary for your platform can be found at: |
| 43 | +http://www.cmake.org/cmake/resources/software.html |
| 44 | + |
| 45 | +1. POSIX (Linux, QNX, FreeBSD, MacOS) |
| 46 | +In console type: |
| 47 | +# mkdir build; cd build |
| 48 | +# cmake <this_file_dir> |
| 49 | +# make |
| 50 | + |
| 51 | +2. Windows |
| 52 | +Use cmake-gui application for building project files for your |
| 53 | +IDE (currently supported: Visual Studio, Borland C++, CodeBlocks (MinGW), Eclipse (MinGW)). |
| 54 | + |
| 55 | +Under QtCreator (v. 2.2.1) you can open Cmake projects directly from the |
| 56 | +IDE (File -> Open Project) |
| 57 | + |
| 58 | +Alternatively, if you want to build project for Visual Studio, you can |
| 59 | +do it directly from the console in true-Linux style =): |
| 60 | + |
| 61 | +# mkdir build; cd build |
| 62 | +# cmake <this_file_dir> |
| 63 | +# %VS90COMNTOOLS%\vsvars32.bat |
| 64 | +# nmake |
| 65 | + |
| 66 | +Note, that if you have Visual Studio 10.0 (2010) environment variable will |
| 67 | +be %VS100COMNTOOLS% and so on. |
| 68 | + |
| 69 | +|---------------------------------------------------------------------------------------------------------------| |
| 70 | +| Running Test Application | |
| 71 | +|---------------------------------------------------------------------------------------------------------------| |
| 72 | +1. Simply start application and ensure, that 10 first tests pass. |
| 73 | +2. Start application with parameters: |
| 74 | + -i <this_file_dir>/ini-test/test1.ini -o out_file.ini |
| 75 | + and ensure that file <application_dir>/out_file.ini contains all the stuff from ini files in test directory |
0 commit comments