mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Initial commit
This commit is contained in:
27
blacklib/samples/config/main.cpp
Normal file
27
blacklib/samples/config/main.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <QCoreApplication>
|
||||
#include <blackmisc/debug.h>
|
||||
#include <blackmisc/config_manager.h>
|
||||
#include <blackmisc/config.h>
|
||||
#include <limits>
|
||||
#include <iostream>
|
||||
|
||||
using namespace BlackMisc;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
BlackMisc::CApplicationContext myApplicationContext;
|
||||
|
||||
CConfigManager::getInstance().setConfigPath(QString("config"));
|
||||
if (!CConfigManager::getInstance().readConfig())
|
||||
{
|
||||
bWarning << "To run this sample, there must be a config folder";
|
||||
bWarning << "in the same directory, containing *.cfg files.";
|
||||
}
|
||||
|
||||
CConfig *myConfig = CConfigManager::getInstance().getConfig("position");
|
||||
bAssert(myConfig);
|
||||
myConfig->display();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user