QuasarAppLib
QuasarAppUtils Namespace Reference

The QuasaraAppUtils class This lib include base functions for the all applications of QuasarApp group. All methods of the Quasar AppUtils is static. More...

Namespaces

namespace  Help
 Help namespace contains functions for printing help in to console. All Print fucntions automaticly calc width of the console and aligns the text to fit the window.
 

Classes

class  HumanReadableObject
 The HumanReadableObject interface This is simple class that add one virtula method toString. All childs object should be override this method. More...
 
class  ISettings
 The Settings class base interface for implementation settings backends. Available implementations: Setting (based on QSettings backend) More...
 
class  Locales
 The Locales class for parese local files Example : More...
 
class  OptionData
 The OptionData class contains information about one option. More...
 
class  PlatformUtils
 The iPlatformUtils class bas interface for get access platform dependet functions and constants. More...
 
class  QALogger
 The QALogger class is logger handler for app. This class allow to log all message from app to file. More...
 
class  QASecretService
 The qasecretservice class This is a simeple provider of QASecretService tool See https://github.com/QuasarApp/SecretService. More...
 
class  Service
 The Service class is a template class for creating a singleton services objects. This is manual control wrapper. You should be manually initializing your service object and manually deinitializing. If you don't destroy your service, then service object will be automatically destroyed when application will be closed. More...
 
class  Settings
 The Settings class This is wraper of the QSettings object. More...
 
class  SettingsListner
 The SettingsListner class is listner of the ISettings global object. The SettingsListner class is abstrct class and contains only one method for hendling settings changes. More...
 
class  ValidableObject
 The ValidableObject class is Base interface for all object that can be checked to valid. More...
 

Typedefs

typedef HumanReadableObject iHRO
 iHRO This is short abriviature of the HumanReadableObject class.
 
typedef QMultiHash< QString, OptionDataOptionsDataList
 OptionsList is Hash map of the OptionData items. Where the key it is group name and value it is option data.
 
typedef ValidableObject iVO
 iVO This is short abriviature of the ValidableObject class.
 

Enumerations

enum class  SettingsSaveMode : quint64 { Auto , Manual }
 The SettingsSaveMode enum. More...
 
enum  VerboseLvl { Error = 0x0 , Warning = 0x1 , Info = 0x2 , Debug = 0x3 }
 The VerboseLvl enum uses for sets log level. More...
 

Functions

constexpr std::array< uint32_t, 256 > generateCrc32Table (uint32_t polynomial=0xEDB88320)
 generateCrc32Table This method generate crc32 table for fast calculate crc32 hash.
 
constexpr uint32_t calculateCrc32 (const char *data, size_t size, uint32_t initialCrc=0xFFFFFFFF)
 calculateCrc32 This method calculate crc32 hash for data.
 
constexpr uint16_t calculateCrc16 (const char *data, size_t size, uint32_t initialCrc=0xFFFFFFFF)
 calculateCrc16 This method calculate crc16 hash for data.
 
constexpr uint16_t calculateCrc8 (const char *data, size_t size, uint32_t initialCrc=0xFFFFFFFF)
 calculateCrc8 This method calculate crc8 hash for data.
 
bool checkLogType (QtMsgType type, VerboseLvl lvl)
 
void messageHandler (QtMsgType type, const QMessageLogContext &context, const QString &msg)
 

Variables

constexpr std::array< uint32_t, 256 > crc32Table = generateCrc32Table()
 crc32Table This is crc32 table for fast calculate crc32 hash.
 

Detailed Description

The QuasaraAppUtils class This lib include base functions for the all applications of QuasarApp group. All methods of the Quasar AppUtils is static.

Typedef Documentation

◆ iHRO

iHRO This is short abriviature of the HumanReadableObject class.

Definition at line 36 of file humanreadableobject.h.

◆ iVO

iVO This is short abriviature of the ValidableObject class.

Definition at line 32 of file validableobject.h.

◆ OptionsDataList

OptionsList is Hash map of the OptionData items. Where the key it is group name and value it is option data.

Definition at line 150 of file optiondata.h.

Enumeration Type Documentation

◆ SettingsSaveMode

The SettingsSaveMode enum.

Enumerator
Auto 

a settings will be saved on hard disk when called the Settings::setValue method.

Manual 

a settings will be saved on hard disk when called the Settings::Sync method.

Definition at line 23 of file isettings.h.

◆ VerboseLvl

The VerboseLvl enum uses for sets log level.

Enumerator
Error 

Error message. This logs will marked as a Error and printing if the verbose lvl >= 0.

Warning 

Warning message. This logs will marked as a Warning and printing if the verbose lvl >= 1.

Info 

General information. This logs will marked as a Info and and printing if the verbose lvl >= 2.

Debug 

Debug message. This logs will marked as a Debug and printing if the verbose lvl >= 3.

Definition at line 23 of file params.h.

Function Documentation

◆ calculateCrc16()

constexpr uint16_t QuasarAppUtils::calculateCrc16 ( const char data,
size_t  size,
uint32_t  initialCrc = 0xFFFFFFFF 
)
constexpr

calculateCrc16 This method calculate crc16 hash for data.

Parameters
dataThis is data for calculate crc16 hash.
sizeThis is size of data.
initialCrcThis is initial crc value.
Returns
return crc16 hash for data.
Note
This method is constexpr and available in compile time.

Definition at line 66 of file crc32constexper.h.

Here is the call graph for this function:

◆ calculateCrc32()

constexpr uint32_t QuasarAppUtils::calculateCrc32 ( const char data,
size_t  size,
uint32_t  initialCrc = 0xFFFFFFFF 
)
constexpr

calculateCrc32 This method calculate crc32 hash for data.

Parameters
dataThis is data for calculate crc32 hash.
sizeThis is size of data.
initialCrcThis is initial crc value.
Returns
return crc32 hash for data.
Note
This method is constexpr and available in compile time.

Definition at line 50 of file crc32constexper.h.

Here is the caller graph for this function:

◆ calculateCrc8()

constexpr uint16_t QuasarAppUtils::calculateCrc8 ( const char data,
size_t  size,
uint32_t  initialCrc = 0xFFFFFFFF 
)
constexpr

calculateCrc8 This method calculate crc8 hash for data.

Parameters
dataThis is data for calculate crc8 hash.
sizeThis is size of data.
initialCrcThis is initial crc value.
Returns
return crc8 hash for data.
Note
This method is constexpr and available in compile time.

Definition at line 78 of file crc32constexper.h.

Here is the call graph for this function:

◆ checkLogType()

bool QuasarAppUtils::checkLogType ( QtMsgType  type,
VerboseLvl  lvl 
)

Definition at line 38 of file qalogger.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateCrc32Table()

constexpr std::array< uint32_t, 256 > QuasarAppUtils::generateCrc32Table ( uint32_t  polynomial = 0xEDB88320)
constexpr

generateCrc32Table This method generate crc32 table for fast calculate crc32 hash.

Parameters
polynomialThis is polynomial for crc32 hash.
Returns
return table for fast calculate crc32 hash.
Note
This method is constexpr and available in compile time.

Definition at line 24 of file crc32constexper.h.

◆ messageHandler()

void QuasarAppUtils::messageHandler ( QtMsgType  type,
const QMessageLogContext context,
const QString msg 
)

Definition at line 51 of file qalogger.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ crc32Table

constexpr std::array<uint32_t, 256> QuasarAppUtils::crc32Table = generateCrc32Table()
constexpr

crc32Table This is crc32 table for fast calculate crc32 hash.

Note
This table is used for fast calculate crc32 hash.

Definition at line 40 of file crc32constexper.h.