是否有C ++的C ++跨平台键/值API或库?

时间:2022-05-17 02:27:25

We want to persist some user settings int he GUI part of our code. I used to do Win32 programming exclusively and the typical way this was done was with registry settings.

我们希望在代码的GUI部分中保留一些用户设置。我曾经独自完成Win32编程,这种方式的典型方法是使用注册表设置。

I assume that this should be done with configuration files, but was wondering if there was a library or cross platform wrapper that made key/value pair persistence very easy.

我假设这应该用配置文件完成,但是想知道是否有一个库或跨平台包装器使得键/值对持久性变得非常容易。

8 个解决方案

#1


7  

Qt's QSettings class handles this:

Qt的QSettings类处理这个:

http://doc.qt.nokia.com/4.6/qsettings.html

#2


7  

Boost.PropertyTree supports XML, JSON, INI config files.

Boost.PropertyTree支持XML,JSON,INI配置文件。

#3


3  

There is also JSON for a lighter alternative of XML. Lots of implementations on that page too.

还有JSON可以替代XML。该页面上的大量实现也是如此。

#4


2  

Qt 4 has a class for it, named QSettings. Looks exactly like what you need.

Qt 4有一个类,名为QSettings。看起来完全像你需要的。

#5


1  

Why not use an XML as the configuration file. Then you only have to find a cross platform XML library which is easier IMO. Here is a list of nice XML parsing solutions for C++.

为什么不使用XML作为配置文件。然后你只需要找到一个更容易IMO的跨平台XML库。以下列出了适用于C ++的优秀XML解析解决方案。

#6


1  

Old school Berkley DB comes to mind.

想到老派Berkley DB。

#7


1  

Have a look at Tokyo Cabinet or at Embedded InnoDB.

看看Tokyo Cabinet或Embedded InnoDB。

#8


1  

In the old days we used .ini files in windows. Here is a portable version of an ini file read/write library
It will work on Windows as well as Linux.

在过去,我们在Windows中使用.ini文件。这是一个可移植版本的ini文件读/写库它可以在Windows和Linux上运行。

#1


7  

Qt's QSettings class handles this:

Qt的QSettings类处理这个:

http://doc.qt.nokia.com/4.6/qsettings.html

#2


7  

Boost.PropertyTree supports XML, JSON, INI config files.

Boost.PropertyTree支持XML,JSON,INI配置文件。

#3


3  

There is also JSON for a lighter alternative of XML. Lots of implementations on that page too.

还有JSON可以替代XML。该页面上的大量实现也是如此。

#4


2  

Qt 4 has a class for it, named QSettings. Looks exactly like what you need.

Qt 4有一个类,名为QSettings。看起来完全像你需要的。

#5


1  

Why not use an XML as the configuration file. Then you only have to find a cross platform XML library which is easier IMO. Here is a list of nice XML parsing solutions for C++.

为什么不使用XML作为配置文件。然后你只需要找到一个更容易IMO的跨平台XML库。以下列出了适用于C ++的优秀XML解析解决方案。

#6


1  

Old school Berkley DB comes to mind.

想到老派Berkley DB。

#7


1  

Have a look at Tokyo Cabinet or at Embedded InnoDB.

看看Tokyo Cabinet或Embedded InnoDB。

#8


1  

In the old days we used .ini files in windows. Here is a portable version of an ini file read/write library
It will work on Windows as well as Linux.

在过去,我们在Windows中使用.ini文件。这是一个可移植版本的ini文件读/写库它可以在Windows和Linux上运行。