11# define HPP_ALIB_LOX_PROPPERINCLUDE
13# undef HPP_ALIB_LOX_PROPPERINCLUDE
18namespace alib {
namespace lox {
namespace detail {
29: Name (allocator, name)
31, SubDomains (allocator)
35 Data .reserve(
size_t( 2 ) );
41 fullPath[name.
Length()]=
'/';
48: Name( parent->Data.get_allocator().GetAllocator(), name )
50, SubDomains ( parent->Data.get_allocator().GetAllocator() )
51, Data ( parent->Data.get_allocator().GetAllocator() )
55 if( parent !=
nullptr )
63 if ( dom != this || dom->Parent == nullptr )
64 fullPath.InsertAt(
"/" , 0 );
65 fullPath.InsertAt( dom->Name, 0 );
68 while( dom !=
nullptr );
79 if ( wasCreated ==
nullptr )
95 if ( lenBeforeTrim > domainPath.
Length() )
97 while (startDomain->
Parent !=
nullptr )
98 startDomain= startDomain->
Parent;
102 return startDomain->
findRecursive( domainPath, maxCreate, wasCreated );
111 ALIB_ASSERT_ERROR( endSubName != 0,
"ALOX",
"Internal error. This must never happen." )
115 if ( endSubName > 0 )
116 domainPath.
Split<
NC>( endSubName, restOfDomainPath, 1 );
119 Domain* subDomain=
nullptr;
126 else if( domainPath.
Equals<
NC>(
".." ) )
133 bool fixedOnce=
false;
141 if( comparison >= 0 )
143 if ( comparison == 0 )
144 subDomain= &(*subDomainIt);
151 if ( subDomain !=
nullptr )
159 bool illegalCharacterFound=
false;
160 for(
int i= 0; i< domainPath.
Length() ; ++i )
162 nchar c= domainPath[i];
164 || ( c >=
'A' && c <=
'Z' )
169 illegalCharacterFound=
true;
171 *
const_cast<nchar*
>( domainPath.
Buffer() + i)=
'#';
175 if ( illegalCharacterFound )
180 if ( maxCreate == 0 )
184 subDomainIt=
SubDomains.Emplace( subDomainIt,
this, domainPath );
186 if ( maxCreate == 0 )
187 return &(*subDomainIt);
194 ? subDomain->findRecursive( restOfDomainPath, maxCreate, wasCreated )
207 subDomain.SetVerbosity( loggerNo, verbosity, priority );
216 subDomain.addLoggerRecursive( logger );
221 Data.erase(
Data.begin() + loggerNo );
223 subDomain.removeLoggerRecursive( loggerNo );
233 for(
size_t i= 0; i <
Data.size() ; ++i )
236 tAString.
_(i!=0 ?
", " :
"" )
ALIB_API void removeLoggerRecursive(int loggerNo)
Domain * Parent
The parent domain. For root domains, this is nullptr.
ALIB_API Verbosity SetVerbosity(int loggerNo, Verbosity verbosity, Priority priority)
void ToString(NAString &target)
NString FullPath
The full path of the domain (set in the constructor once) .
StdVectorMono< LoggerData > Data
ALIB_API void addLoggerRecursive(detail::Logger *logger)
Domain * findRecursive(NSubstring &domainPath, int maxCreate, bool *wasCreated)
ALIB_API Domain(MonoAllocator &allocator, PoolAllocator &pool, const NString &name)
List< MonoAllocator, Domain, Recycling::None > SubDomains
A list of subdomains, sorted by name.
static constexpr nchar Separator()
ALIB_API Domain * Find(NSubstring domainPath, int maxCreate, bool *wasCreated)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
integer IndexOf(TChar needle, integer startIdx=0) const
constexpr bool IsEmpty() const
void Allocate(TAllocator &allocator, const TString< TChar > ©)
constexpr bool IsNotEmpty() const
constexpr integer Length() const
integer CopyTo(TChar *dest) const
bool Equals(const TString< TChar > &rhs) const
constexpr const TChar * Buffer() const
TSubstring & Split(integer position, TSubstring &target, integer separatorWidth=0, bool trim=false)
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
@ PrefixLogables
Prefix logables.
strings::TFormat< nchar > NFormat
Type alias in namespace alib.
strings::TString< nchar > NString
Type alias in namespace alib.
characters::nchar nchar
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
Internal class that holds data stored per Logger.
int LogCallsPerDomain
the number of log calls on this domain for this logger.
Verbosity LoggerVerbosity
The verbosity of the Logger for this domain.
config::Priority Priority
The priority value that was used to set the verbosity.