2019-11-25 12:08:34 +00:00
|
|
|
#include <myx/base/config.hpp>
|
|
|
|
|
2019-10-08 20:58:42 +00:00
|
|
|
#include <myx/filesystem/paths.hpp>
|
2020-04-09 06:34:55 +00:00
|
|
|
#include <myx/filesystem/paths_mt.hpp>
|
2019-10-04 09:48:12 +00:00
|
|
|
|
2019-11-25 12:08:34 +00:00
|
|
|
#include <QCoreApplication>
|
2020-04-09 06:34:55 +00:00
|
|
|
#include <QDebug>
|
2019-11-25 12:08:34 +00:00
|
|
|
|
2020-04-22 07:17:37 +00:00
|
|
|
#define CMLIB_PROJECT_NAME "myxlib"
|
|
|
|
|
2019-10-04 09:48:12 +00:00
|
|
|
namespace MF = myx::filesystem;
|
|
|
|
|
2020-04-09 06:34:55 +00:00
|
|
|
// Переменные для защиты экземпляра класса MF::PathsMT
|
2020-05-06 14:59:39 +00:00
|
|
|
std::atomic< MF::PathsMT* > MF::PathsMT::sInstance;
|
|
|
|
std::mutex MF::PathsMT::sMutex;
|
2019-10-04 09:48:12 +00:00
|
|
|
|
2020-04-22 07:17:37 +00:00
|
|
|
|
2019-10-04 09:48:12 +00:00
|
|
|
int main( int argc, char** argv )
|
|
|
|
{
|
|
|
|
(void)argc;
|
|
|
|
(void)argv;
|
2020-04-05 14:28:55 +00:00
|
|
|
QCoreApplication::setApplicationName( QStringLiteral( CMLIB_PROJECT_NAME ) );
|
2020-04-09 06:45:20 +00:00
|
|
|
MF::PathsMT& pathsMT = MF::PathsMT::instance();
|
|
|
|
MF::Paths& paths = MF::Paths::instance();
|
|
|
|
|
|
|
|
pathsMT.init( QStringLiteral( CMLIB_PROJECT_NAME ), QStringLiteral( "conf" ) );
|
|
|
|
pathsMT.findConfigFile( QStringLiteral( "test" ) );
|
2020-05-15 08:13:26 +00:00
|
|
|
qDebug() << pathsMT.systemLogDirectory();
|
|
|
|
qDebug() << pathsMT.systemConfigDirectory();
|
2020-04-09 06:45:20 +00:00
|
|
|
|
|
|
|
paths.init( QStringLiteral( CMLIB_PROJECT_NAME ), QStringLiteral( "conf" ) );
|
2020-05-15 12:54:31 +00:00
|
|
|
|
|
|
|
qDebug() << "executableName : " << paths.executableName();
|
|
|
|
qDebug() << "executableFilePath : " << paths.executableFilePath();
|
|
|
|
qDebug() << "executableDirectory : " << paths.executableDirectory();
|
|
|
|
|
|
|
|
qDebug() << "configFileName : " << paths.configFileName();
|
|
|
|
qDebug() << "configFilePath : " << paths.configFilePath();
|
|
|
|
|
|
|
|
qDebug() << "systemConfigDirectory : " << paths.systemConfigDirectory();
|
|
|
|
qDebug() << "systemConstDataDirectory : " << paths.systemConstDataDirectory();
|
|
|
|
qDebug() << "systemVarDataDirectory : " << paths.systemVarDataDirectory();
|
|
|
|
qDebug() << "systemLogDirectory : " << paths.systemLogDirectory();
|
|
|
|
|
|
|
|
qDebug() << "userConfigDirectory : " << paths.userConfigDirectory();
|
|
|
|
qDebug() << "userConstDataDirectory : " << paths.userConstDataDirectory();
|
|
|
|
qDebug() << "userVarDataDirectory : " << paths.userVarDataDirectory();
|
|
|
|
qDebug() << "userLogDirectory : " << paths.userLogDirectory();
|
2019-10-04 09:48:12 +00:00
|
|
|
|
|
|
|
return( 0 );
|
2020-05-15 17:14:21 +00:00
|
|
|
} // main
|