myxlib/examples/filesystem/01_minimal/minimal.cpp

38 lines
1.1 KiB
C++
Raw Normal View History

2019-11-25 12:08:34 +00:00
#include <myx/base/config.hpp>
#include <myx/filesystem/paths.hpp>
#include <myx/filesystem/paths_mt.hpp>
2019-11-25 12:08:34 +00:00
#include <QCoreApplication>
#include <QDebug>
2019-11-25 12:08:34 +00:00
2020-04-22 07:17:37 +00:00
#define CMLIB_PROJECT_NAME "myxlib"
namespace MF = myx::filesystem;
// Переменные для защиты экземпляра класса MF::PathsMT
std::atomic< MF::PathsMT* > MF::PathsMT::mInstance;
std::mutex MF::PathsMT::mMutex;
2020-04-22 07:17:37 +00:00
int main( int argc, char** argv )
{
(void)argc;
(void)argv;
QCoreApplication::setApplicationName( QStringLiteral( CMLIB_PROJECT_NAME ) );
MF::PathsMT& pathsMT = MF::PathsMT::instance();
MF::Paths& paths = MF::Paths::instance();
pathsMT.init( QStringLiteral( CMLIB_PROJECT_NAME ), QStringLiteral( "conf" ) );
pathsMT.findConfigFile( QStringLiteral( "test" ) );
qDebug() << pathsMT.systemLogDirectory().path();
qDebug() << pathsMT.systemConfigDirectory().path();
paths.init( QStringLiteral( CMLIB_PROJECT_NAME ), QStringLiteral( "conf" ) );
paths.findConfigFile( QStringLiteral( "test" ) );
qDebug() << paths.systemConstDataDirectory().path();
qDebug() << paths.configFileName();
return( 0 );
}