Giter VIP home page Giter VIP logo

simpleini's Introduction

simpleini

Test Results Linux

A cross-platform library that provides a simple API to read and write INI-style configuration files. It supports data files in ASCII, MBCS and Unicode. It is designed explicitly to be portable to any platform and has been tested on Windows, WinCE and Linux. Released as open-source and free using the MIT licence.

Feature Summary

  • MIT Licence allows free use in all software (including GPL and commercial)
  • multi-platform (Windows 95 to Windows 10, Windows CE, Linux, Unix)
  • loading and saving of INI-style configuration files
  • configuration files can have any newline format on all platforms
  • liberal acceptance of file format
    • key/values with no section, keys with no value
    • removal of whitespace around sections, keys and values
  • support for multi-line values (values with embedded newline characters)
  • optional support for multiple keys with the same name
  • optional case-insensitive sections and keys (for ASCII characters only)
  • saves files with sections and keys in the same order as they were loaded
  • preserves comments on the file, section and keys where possible
  • supports both char or wchar_t programming interfaces
  • supports both MBCS (system locale) and UTF-8 file encodings
  • system locale does not need to be UTF-8 on Linux/Unix to load UTF-8 file
  • support for non-ASCII characters in section, keys, values and comments
  • support for non-standard character types or file encodings via user-written converter classes
  • support for adding/modifying values programmatically
  • should compile with no warnings in most compilers

Documentation

Full documentation of the interface is available in doxygen format.

Examples

These snippets are included with the distribution in the automatic tests as ts-snippets.cpp.

SIMPLE USAGE

	// simple demonstration

	CSimpleIniA ini;
	ini.SetUnicode();

	SI_Error rc = ini.LoadFile("example.ini");
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_OK);

	const char* pv;
	pv = ini.GetValue("section", "key", "default");
	ASSERT_STREQ(pv, "value");

	ini.SetValue("section", "key", "newvalue");

	pv = ini.GetValue("section", "key", "default");
	ASSERT_STREQ(pv, "newvalue");

LOADING DATA

	// load from a data file
	CSimpleIniA ini;
	SI_Error rc = ini.LoadFile("example.ini");
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_OK);

	// load from a string
	const std::string example = "[section]\nkey = value\n";
	CSimpleIniA ini;
	SI_Error rc = ini.LoadData(example);
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_OK);

GETTING SECTIONS AND KEYS

	// get all sections
	CSimpleIniA::TNamesDepend sections;
	ini.GetAllSections(sections);

	// get all keys in a section
	CSimpleIniA::TNamesDepend keys;
	ini.GetAllKeys("section1", keys);

GETTING VALUES

	// get the value of a key that doesn't exist
	const char* pv;
	pv = ini.GetValue("section1", "key99");
	ASSERT_EQ(pv, nullptr);

	// get the value of a key that does exist
	pv = ini.GetValue("section1", "key1");
	ASSERT_STREQ(pv, "value1");

	// get the value of a key which may have multiple 
	// values. If hasMultiple is true, then there are
	// multiple values and just one value has been returned
	bool hasMulti;
	pv = ini.GetValue("section1", "key1", nullptr, &hasMulti);
	ASSERT_STREQ(pv, "value1");
	ASSERT_EQ(hasMulti, false);

	pv = ini.GetValue("section1", "key2", nullptr, &hasMulti);
	ASSERT_STREQ(pv, "value2.1");
	ASSERT_EQ(hasMulti, true);

	// get all values of a key with multiple values
	CSimpleIniA::TNamesDepend values;
	ini.GetAllValues("section1", "key2", values);

	// sort the values into a known order, in this case we want
	// the original load order
	values.sort(CSimpleIniA::Entry::LoadOrder());

	// output all of the items
	CSimpleIniA::TNamesDepend::const_iterator it;
	for (it = values.begin(); it != values.end(); ++it) {
		printf("value = '%s'\n", it->pItem);
	}

MODIFYING DATA

	// add a new section 
	rc = ini.SetValue("section1", nullptr, nullptr);
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_INSERTED); 

	// not an error to add one that already exists
	rc = ini.SetValue("section1", nullptr, nullptr);
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_UPDATED);

	// get the value of a key that doesn't exist
	const char* pv;
	pv = ini.GetValue("section2", "key1", "default-value");
	ASSERT_STREQ(pv, "default-value");

	// adding a key (the section will be added if needed)
	rc = ini.SetValue("section2", "key1", "value1");
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_INSERTED);

	// ensure it is set to expected value
	pv = ini.GetValue("section2", "key1", nullptr);
	ASSERT_STREQ(pv, "value1");

	// change the value of a key
	rc = ini.SetValue("section2", "key1", "value2");
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_UPDATED);

	// ensure it is set to expected value
	pv = ini.GetValue("section2", "key1", nullptr);
	ASSERT_STREQ(pv, "value2");

DELETING DATA

	// deleting a key from a section. Optionally the entire
	// section may be deleted if it is now empty.
	bool done, deleteSectionIfEmpty = true;
	done = ini.Delete("section1", "key1", deleteSectionIfEmpty);
	ASSERT_EQ(done, true);
	done = ini.Delete("section1", "key1");
	ASSERT_EQ(done, false);

	// deleting an entire section and all keys in it
	done = ini.Delete("section2", nullptr);
	ASSERT_EQ(done, true);
	done = ini.Delete("section2", nullptr);
	ASSERT_EQ(done, false);

SAVING DATA

	// save the data to a string
	std::string data;
	rc = ini.Save(data);
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_OK);

	// save the data back to the file
	rc = ini.SaveFile("example2.ini");
	if (rc < 0) { /* handle error */ };
	ASSERT_EQ(rc, SI_OK);

simpleini's People

Contributors

abouvier avatar amdmi3 avatar brofield avatar chocobo1 avatar csware avatar dacap avatar dimitripapadopoulos avatar glebm avatar iondune avatar leokoppel avatar ngdream avatar noryb009 avatar topazus avatar viniciusferrao avatar vladon avatar vshawn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simpleini's Issues

Errors on import

Hi. I downloaded this parser and put simpleIni.h, convertUTF.h and convertUTF.c in my project folder. When I run this code:

`
#ifdef _WIN32
#pragma warning(disable: 4786)
#endif

#ifdef _WIN32
#include <windows.h>
#define DELETE_FILE DeleteFileA
#else
#include <unistd.h>
#define DELETE_FILE unlink
#endif
#include

#define SI_SUPPORT_IOSTREAMS

#include
#include "SimpleIni.h"

using namespace std;

int main()
{
return 0;
}
`

I get 4 errors:

||=== Build: Release in INIReader (compiler: GNU GCC Compiler) ===|
C:\Users\M0097932\Desktop\firstTest\INIReader\main.cpp|2|warning: ignoring #pragma warning [-Wunknown-pragmas]|
C:\Users\M0097932\Desktop\firstTest\INIReader\SimpleIni.h||In member function 'SI_Error CSimpleIniTempl<SI_CHAR, SI_STRLESS, SI_CONVERTER>::LoadFile(const wchar_t*)':|
C:\Users\M0097932\Desktop\firstTest\INIReader\SimpleIni.h|1356|error: there are no arguments to '_wfopen' that depend on a template parameter, so a declaration of '_wfopen' must be available [-fpermissive]|
C:\Users\M0097932\Desktop\firstTest\INIReader\SimpleIni.h|1356|note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)|
C:\Users\M0097932\Desktop\firstTest\INIReader\SimpleIni.h||In member function 'SI_Error CSimpleIniTempl<SI_CHAR, SI_STRLESS, SI_CONVERTER>::SaveFile(const wchar_t*, bool) const':|
C:\Users\M0097932\Desktop\firstTest\INIReader\SimpleIni.h|2376|error: there are no arguments to '_wfopen' that depend on a template parameter, so a declaration of '_wfopen' must be available [-fpermissive]|
C:\Users\M0097932\Desktop\firstTest\INIReader\SimpleIni.h||In member function 'bool SI_NoCase<SI_CHAR>::operator()(const SI_CHAR*, const SI_CHAR*) const':|
C:\Users\M0097932\Desktop\firstTest\INIReader\SimpleIni.h|3271|error: there are no arguments to '_mbsicmp' that depend on a template parameter, so a declaration of '_mbsicmp' must be available [-fpermissive]|
C:\Users\M0097932\Desktop\firstTest\INIReader\SimpleIni.h|3275|error: there are no arguments to '_wcsicmp' that depend on a template parameter, so a declaration of '_wcsicmp' must be available [-fpermissive]|
||=== Build failed: 4 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|

Can you help me?

LoadFile() fails on empty file with Unicode, UTF-8

Ran into this when trying a simple "will this compile and run?" without anything in the ini file. SI_CONVERT_WIN32 is set.

const PWSTR filename= L"empty.ini";

CSimpleIniW ini(true, false, false);

// Write empty file
SI_Error retval = ini.SaveFile(filename);
assert(retval == SI_OK);

// Attempt to load empty file - fails
retval = ini.LoadFile(filename);
assert(retval == SI_FAIL);

The problem seems to be in the Windows version of SizeFromStore for that combination of flags. It calls MultiByteToWideChar with a cbMultiByte of 0, which fails.

I'll see if there's a safe simple fix but I'm not familiar with these character set functions. Otherwise, this may at least help someone else who runs into the issue.

Handle list of values?

Is it possible to parse a key with a list of values, such as
items = A B C D
num_items = 10 3 8 99
item_weights = 1.2 3.5 4.8 5.0

Thank you.

simpleopt question

is it possible to use simpleinit for default option
and overwrite this option in command line using simpleopt ?
sorry for this newbie question ?

move semantics

Why not support move semantics (move ctor and move operator=)?

Strings with quotes not parsed correctly

If I have a property value string like this in the ini file:

property = "value"

It's not parsed correctly and the resulting string contains the quotes. My understanding of the ini convention is that value and "value" should be the same string.

Allow empty string (eg. "" ('\0')) as valid comment for AddEntry function

Is it possible to allow "" to be a valid comment for any of the ini file setter functions?
Right now, it seems that only NULL or a char sequence starting with ';' or '#' may be used as a comment.
Passing to "" to SetValue ends in a failing assertion

SI_ASSERT(!a_pComment || IsComment(*a_pComment));

A solution could be to define

/** Does the supplied character start a comment line? */
inline bool IsComment(SI_CHAR ch) const {
    return (ch == ';' || ch == '#' || ch == '\0');
}

I am not quite sure if anything else will have to be changed for this to work correctly.

CSimpleIniW is unable to read the desktop.ini

Just tried to read the desktop.ini in the "Documents" folder.
I used CSimpleIniW for this, this file is in UTF-16. Nothing was read, I tried to iterate through the section names.

Compilation fails due to unused parameter

Reported by saanti, May 20, 2013

What steps will reproduce the problem?

  1. Try to compile with strict settings (-Werror)

What is the expected output? What do you see instead?
Compilation fails for function SizeFromStore with:
./SimpleIni.h:2828:25: error: unused parameter 'a_pInputData'
[-Werror,-Wunused-parameter]
const char * a_pInputData,

What version of the product are you using? On what operating system?
SVN head on Mac OS X 10.8.2, using clang 4.1

Please provide any additional information below.

value returned by GetValue for multiline includes ENDTAG

Platform: Windows
Compiler: VS 2008, 32-bit

When getting a multi-line value for a key, GetValue() returns string that has the ENDTAG included. I get the same result when walking through TKeyVal of a section.
It happens only when ENDTAG is followed by white-space.

Regards,
Michal.

Program Files read/write permission for ini file?

Hi there!

Just want to say I'm very new to c++ and also new to using this header file.

I have a script running for a game and save the configuration for a mod menu to where the mod is located.

It works perfectly, but it seems that if the game is located in Program Files, my mod does not even load at all.

I'm sorry that this is such a small amount of information, but I have no idea where to turn since there are a lot of factors out of my control like not being able to properly debug what's going on since my mod is loaded by a different library.

I'm almost certain that this has to do with where the game is saved and file permissions, but simply want to know if there is any way around this. This is a mod menu for RDR2 Single Player I'm working on just for a bit more context if it helps.

The loading, saving and creating (if the file was not found) works perfectly, but yet again my mod doesn't even load when the game is located in the Program Files folder. Could something put in place by the game devs be blocking file creation or something along those lines?

I hope you'll be able to assist. Thanks for your time

SimpleIni.h method not in scope

SimpleIni.h ln 421 SizeToStore method is not in the scope.
instead of
size_t uLen = SizeToStore(a_pszString);
should be
size_t uLen = SI_CONVERTER::SizeToStore(a_pszString);

Doesn't compile under VS2019 with c++17 enabled

1>C:\src\wordtsar\third-party\simpleini\SimpleIni.h(327,47): error C2143: syntax error: missing ',' before '<' (compiling source file src\gui\editor\editorctrl.cpp)
1>C:\src\wordtsar\third-party\simpleini\SimpleIni.h(329): message : see reference to class template instantiation 'CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::Entry::KeyOrder' being compiled (compiling source file src\gui\editor\editorctrl.cpp)
1>C:\src\wordtsar\third-party\simpleini\SimpleIni.h(338): message : see reference to class template instantiation 'CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::Entry' being compiled (compiling source file src\gui\editor\editorctrl.cpp)
1>C:\src\wordtsar\third-party\simpleini\SimpleIni.h(1294): message : see reference to class template instantiation 'CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>' being compiled (compiling source file src\gui\editor\editorctrl.cpp)
1>C:\src\wordtsar\third-party\simpleini\SimpleIni.h(335,48): error C2143: syntax error: missing ',' before '<' (compiling source file src\gui\editor\editorctrl.cpp)
1>C:\src\wordtsar\third-party\simpleini\SimpleIni.h(338): message : see reference to class template instantiation 'CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::Entry::LoadOrder' being compiled (compiling source file src\gui\editor\editorctrl.cpp)
1>C:\src\wordtsar\third-party\simpleini\SimpleIni.h(327,32): error C2039: 'binary_function': is not a member of 'std' (compiling source file src\gui\editor\editorctrl.cpp)

Issues by including windows.h

SimpleIni includes windows.h in a header file (SimpleIni.h:3248) which can cause several issues.
windows.h has macros polluting the global namespace.

So for instance when I was trying to use a standard C++11 function: std::numeric_limits::max() it wouldn't compile, because windows.h already defined it (through minwindef.h) and it takes precedence over the standard function I was trying to use.

The particular issue I ran into can be fixed by placing

define NOMINMAX

just before including <windows.h> in SimpleIni.h (and placing #undef NOMINMAX afterwards).

Defining/undefing WIN32_LEAN_AND_MEAN in a similar fashion could also reduce the garbage that gets included with windows.h.

But for the long term, it might be better, if windows.h wouldn't have to be included in the header in the first place. This should be a small little cross-platform code handling ini files, and including windows.h itself can be quite disruptive.

Any planned release after 4.17?

Hi all,
thanks for the project value.
Is there any plan to issue a "tagged" version after 4.17? I saw there are some modifications after the most recent release.
Thank you in advance.

Feedback: OS X

I just wanted to let you know that I am testing this for usage in my IceTea project now (see incbin branch for development).

So far, SimpleIni compiled cleanly with no warnings on OS X 10.10.3, XCode 6.x (Latest). :)

Changes for softrock RXTX and clones

Hi Robert,
Would you let me know what general areas (if you know) that need to be changed to support the Softrock RXTX? Since the Genesis is somewhat similar in that they both use the Si570 my hope is that I can modify your application to be compatible with the Softrock. Actually the rig(s) I have is the Peaberry V2 but its interface API is identical to the Softrock.

73,
Ron / W4MMP

Ini without '=' : is that possible?

Thanks for the code. I have a rather a question than an issue - my files (generated by somebody else) are without equal signs:

[COMMON]
OPEN USB 0 0
GNUPLOT_PATH ""

[0]
ENABLE_INPUT           YES
DC_OFFSET              0
TF_DECAY_TAU 50.0
TRG_THRESHOLD 101

Comments begin with #. Can I use simpleini for this ? My basic attempt didnt work.
Thank you.
Jaro

define SI_NO_CONVERSION not works

// Defines the conversion classes for different libraries. Before including
// SimpleIni.h, set the converter that you wish you use by defining one of the
// following symbols.
//
//  SI_NO_CONVERSION        Do not make the "W" wide character version of the 
//                          library available. Only CSimpleIniA etc is defined.
//  SI_CONVERT_GENERIC      Use the Unicode reference conversion library in
//                          the accompanying files ConvertUTF.h/c
//  SI_CONVERT_ICU          Use the IBM ICU conversion library. Requires
//                          ICU headers on include path and icuuc.lib
//  SI_CONVERT_WIN32        Use the Win32 API functions for conversion.

When I define SI_NO_CONVERSION following the instruction.

image

An error shows up.

image

type SI_NoCase & SI_Case wiil not be defined.

? instead of cyrillic symbols

Hello!
When I save cyrillic symbols(as a value) into my INI I get ������������_�������� instead of them.
Is it possible to save cyrillic symbols?
I tried omitting SetUnicode() or calling SetUnicode(1) with no success.

SetUnicode reading problem

I create a file file unicode markup.
Then I want to read it. But this works only, when I tell the instance that a unicode file will be opened.
I thought the parser will notice and care about the BOM.

#include <iostream>
#include "SimpleIni.h"


int main()
{
#define section "sec"
#define val "value"
#define file "/tmp/file.ini"

  CSimpleIniA writer;
  writer.SetUnicode();
  long value = 10;
  writer.SetLongValue(section,val,value);
  writer.SaveFile(file);

  CSimpleIniA DontWork;
  DontWork.LoadFile(file);
  std::cout<<DontWork.GetLongValue(section,val)<<std::endl;

  CSimpleIniA Work;
  Work.SetUnicode();
  Work.LoadFile(file);
  std::cout<<Work.GetLongValue(section,val)<<std::endl;
}

the content of the created file is:
HEX:
EF BB BF 5B 73 65 63 5D 0A 76 61 6C 75 65 20 3D 20 31 30 0A
ASCII:
[sec] value = 10

memory leak problem

I read all codes,and very like it .Then I have a suspicion that there is a memory leak at line 1318 . But I am not completely sure.So I want to ask for advice so that I will keep using it.
i.e,
if (!m_strings.empty()) {
typename TNamesDepend::iterator i = m_strings.begin();
for (; i != m_strings.end(); ++i) {
delete[] const_cast<SI_CHAR*>(i->pItem);
}
m_strings.erase(m_strings.begin(), m_strings.end());
}
The member variable ,"pComment ",of the struct Entry haven't be deleted.

How to read multiple values?

I saw in the documentation that simpleini supports multiple values per key. I'd like to use this feature, but for the life of me I can't figure out how the ini file has to be written.

I tried the following delimiters: " " (space), "," "|"
I tried the following brackets: none, (values), [values], {values}

So the question is: what syntax do you expect in the ini file, so that I can use the function "ini.GetAllValues("section-name", "key-name", values);"? The sample ini files don't appear to include an example...

Release v4.18?

It would be useful to have a new stable release. In particular, I found a problem compiling with C++17 enabled, and found that the issue was already solved in #31 which is not included yet in any release.

Suggestion: Add Change Section Name API

In some case, need to change already existing section name, but keep original key value not changed.
So far I haven't found an interface in the library that does this, does the project have plans to support this interface?

Files are never closed

If you open multiple .ini files the old handles are never closed.

On a system with limited file descriptors (like on the 3DS for example) this can be a issue

add typedef SI_CHAR in CSimpleIniTempl

Reported by levchenko.yuriy.vladimirovich, May 22, 2013

please add typedef in CSimpleIniTempl

typedef SI_CHAR T_SI_CHAR;

for use:
CSimpleIniTempl::T_SI_CHAR

tnx!

loop bug

I don't know if this project still alive but i have the following problem

I'm trying to read some ini files multiple times in my program but after two or three times it stop working
the file is loading correctly but i can't get any values
I only get (Null) back from GetValue

any suggestion ?

Keys are not saved correctly under root(empty) section, if not added first

Reported by MatthewRDutton, Jul 26, 2010

What steps will reproduce the problem?

  1. Add a key/value pair under a section with a name (e.g. "Foo")
  2. Add a key/value pair under the empty section (i.e. SectionName == "")
  3. Save the file (I used CSimpleIniA::SaveFile(char *).)
  4. Load the file (I used CSimpleIniA::LoadFile(char *).)
  5. The second key (incorrectly) appears under the named section (e.g. "Foo")

What is the expected output? What do you see instead?
I expect a file like:
RootKey=RootValue
[Foo]
FooKey=FooValue
but I get
[Foo]
FooKey=FooValue
RootKey=RootValue
which causes the RootKey to incorrectly be placed under the Foo section.

What version of the product are you using? On what operating system?
Version 4.13 (2010-04-19). Win XP SP2.

Please provide any additional information below.
Built with VS2008 RTM.

For example:
WritePrivateProfileString("Foo", "FooKey", "FooValue", "Test.ini");
WritePrivateProfileString("", "RootKey", "RootValue", "Test.ini");
produces:
[Foo]
FooKey=FooValue
[]
RootKey=RootValue

but:
CSimpleIniA test;
test.SetValue("Foo", "FooKey", "FooValue");
test.SetValue("", "RootKey", "RootValue");
test.SaveFile("Test.ini");
produces:
[Foo]
FooKey=FooValue
[]
RootKey=RootValue

Even if you don't intend to match WritePrivateProfileString, the current implementation causes empty section to be merged with the previous section.

Example test case:
CSimpleIniA test;
test.SetValue("Foo", "FooKey", "FooValue");
test.SetValue("", "RootKey", "RootValue");
test.SaveFile("Test.ini");
test.Reset();
test.LoadFile("Test.ini");
assert( strcmp(test.GetValue("Foo", "RootKey"), "RootValue") != 0 );
assert( strcmp(test.GetValue("", "RootKey"), "RootValue") == 0 );

Jul 26, 2010 Delete comment
#1 MatthewRDutton

I made a typo in my examples at the end. Corrected version:
<>
but:
CSimpleIniA test;
test.SetValue("Foo", "FooKey", "FooValue");
test.SetValue("", "RootKey", "RootValue");
test.SaveFile("Test.ini");
produces:
[Foo]
FooKey=FooValue

RootKey=RootValue

<>

Jul 28, 2010 Delete comment
Project Member #2 brofield

I haven't tested this but it seems correct that this bug would exist. It is due to the sorting of the data for output according to the order that it was created. This is done so that Save will save the data in the same order as the original file. Obviously this breaks down when data is added directly, and the root section is used.

What is needed is that all items in the root section are sorted before all other sections. I'll get to this bug in time.

Status: Accepted
Owner: brofield

Fast Execution

Is it possible to modify this code to remove all frame limiting mechanisms? For instance, if I wanted to adapt this library to allow a machine learning algorithm to process game data at something close to 1000 frames per second (rough number), would that be doable?

Removing the frame limiting mechanism in the run function of the GUI appears to provide some speedup, but are there other modifications to potentially boost this further?

Example Code does not compile

Whenever I try to compile I get

In file included from pch.h:6:0,
                 from pch.h:6,
                 from pch.h:6,
                 from pch.h:6,
                 from pch.h:6,
                 from pch.h:6,
                 from pch.h:6,
                 from pch.h:6,
                 from pch.h:6,
                 from ReadConfig.cpp:4:
pch.h:6:17: error: #include nested too deeply
 #include "pch.h"
                 ^
ReadConfig.cpp: In function 'void GetKey()':
ReadConfig.cpp:18:22: error: 'ASSERT_EQ' was not declared in this scope
   ASSERT_EQ(rc, SI_OK);
                      ^````

Stops reading values.

After it reads a certain amount of values(idk how many exactly) it just stops. How can I fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.