Mirai-Team / mirai-project

C++ library for games making purposes.
Other
3 stars 0 forks source link

Parser : in strings, characters after spaces seems wiped out. #34

Closed CBenoit closed 9 years ago

CBenoit commented 9 years ago

You currently can see it in the parser example. The issue refer to the following code : https://github.com/Mirai-Team/mirai-project/blob/master/examples/parser/src/main.cpp#L85 myStringVector = mp::Parser::vFileParser<string>(clearFileName, "someStringVector", '=', ';');

The config file contains :

someStringVector=abc;hello there !;mirai project

The output test code is :

cout << "someStringVector =";
for (auto value : myStringVector)
    cout << " " << value;
cout << endl;

The expected output is :

someStringVector = abc hello there ! mirai project

However, I got this :

someStringVector = abc hello mirai

Lomadriel commented 9 years ago

You didn't use the correct function.

With string you must use: myStringVector = mp::Parser::vFileParser(clearFileName, "someStringVector", '=', ';');

CBenoit commented 9 years ago

Indeed that works better, but this is kinda ambigous at the end.