Search code examples
javac++equivalence

Equivalence of java.util.ResourceBundle in C++


I have a Java class that uses more lines similar to the following ones

private static final int PARAM_1 = Integer.valueOf(ResourceBundle.getBundle("solution.filtres").getString("filtre.param1.solution"));
private static final int PARAM_2 = Integer.valueOf(ResourceBundle.getBundle("solution.filtres").getString("filtre.param2.solution"));

and the file filtres.properties found in solution folder contains:

filtre.param1.solution=1.5
filtre.param2.solution=6

I know that ResourceBundle is used for user locale, but it seems that it just assigns values to static members from a specific file.

I want to do something similar in C++. I have found this for C++, but it seems a little strange for what it does; so I am asking:

  1. Is it something similar to ResourceBundle in C++ (not what I have found)? If yes, what, and where can I find some examples?
  2. Do you advice me to do it in a simpler way?

I would appreciate some code if anyone did some kind of this assignments.


Solution

  • Using Boost and its pthree and the .xml or .json parser is a better way.