qxLib
Classes | Macros
category.h File Reference
#include <qx/containers/string/string_utils.h>
#include <qx/macros/common.h>
#include <qx/render/color.h>
#include <qx/verbosity.h>
#include <qx/category.inl>

Go to the source code of this file.

Classes

class  qx::category
 A category is a class that identifies a particular piece of code. This code can be located in different files, but united by one functionality. Objects of this class can be used in logging, asserts and profiling. More...
 

Macros

#define QX_DEFINE_CATEGORY(name, ...)   constexpr qx::category name(QXT(#name), ##__VA_ARGS__)
 Define a category. More...
 
#define QX_SET_FILE_CATEGORY(_category)
 Set the file category You can access this value via QX_GET_FILE_CATEGORY() This category will not be exported via #include. More...
 
#define QX_GET_FILE_CATEGORY()   qx::details::file_category<qx::djb2a_hash(QX_SHORT_FILE, 0)>::get()
 Get category defined in QX_SET_FILE_CATEGORY If there is none, CatDefault will be used.
 

Detailed Description

Author
Khrapov
Date
5.12.2022

Definition in file category.h.

Macro Definition Documentation

◆ QX_DEFINE_CATEGORY

#define QX_DEFINE_CATEGORY (   name,
  ... 
)    constexpr qx::category name(QXT(#name), ##__VA_ARGS__)

Define a category.

Parameters
name- category name
...- optional category color

Definition at line 21 of file category.h.

◆ QX_SET_FILE_CATEGORY

#define QX_SET_FILE_CATEGORY (   _category)
Value:
template<> \
{ \
static constexpr const qx::category& get() noexcept \
{ \
return _category; \
} \
}
A category is a class that identifies a particular piece of code. This code can be located in differe...
Definition: category.h:59
#define QX_SHORT_FILE
Cuts full absolute path to the file name only ex: "C:\folder1\folder2\file.h" => "file....
Definition: common.h:34
constexpr size_t djb2a_hash(const value_t *pszStr, size_t nSeed, size_t nLen)
djb2a hash
Definition: string_utils.h:26

Set the file category You can access this value via QX_GET_FILE_CATEGORY() This category will not be exported via #include.

Parameters
_category- category to use in this file

Definition at line 29 of file category.h.