12:
Name (allocator, name)
17 Data .reserve(
size_t( 2 ) );
22 fullPath[name.
Length()]=
'/';
28:
Name( parent->
Data.get_allocator().GetAllocator(), name )
31,
Data ( parent->
Data.get_allocator().GetAllocator() )
34 if( parent !=
nullptr )
42 if ( dom != this || dom->Parent == nullptr )
43 fullPath.InsertAt(
"/" , 0 );
44 fullPath.InsertAt( dom->Name, 0 );
47 while( dom !=
nullptr );
48 FullPath.Allocate(
Data.get_allocator().GetAllocator(), fullPath );
57 if ( wasCreated ==
nullptr )
72 if ( lenBeforeTrim > domainPath.
Length() ) {
73 while (startDomain->
Parent !=
nullptr )
74 startDomain= startDomain->
Parent;
78 return startDomain->
findRecursive( domainPath, maxCreate, wasCreated );
86 ALIB_ASSERT_ERROR( endSubName != 0,
"ALOX",
"Internal error. This must never happen." )
91 domainPath.
Split<
NC>( endSubName, restOfDomainPath, 1 );
94 Domain* subDomain=
nullptr;
101 else if( domainPath.
Equals<
NC>(
".." ) )
107 bool fixedOnce=
false;
113 if( comparison >= 0 ) {
114 if ( comparison == 0 )
115 subDomain= &(*subDomainIt);
122 if ( subDomain !=
nullptr )
129 bool illegalCharacterFound=
false;
130 for(
int i= 0; i< domainPath.
Length() ; ++i ) {
131 nchar c= domainPath[i];
133 || ( c >=
'A' && c <=
'Z' )
138 illegalCharacterFound=
true;
140 *
const_cast<nchar*
>( domainPath.
Buffer() + i)=
'#';
143 if ( illegalCharacterFound )
148 if ( maxCreate == 0 )
152 subDomainIt=
SubDomains.emplace( subDomainIt,
this, domainPath );
154 if ( maxCreate == 0 )
155 return &(*subDomainIt);
161 ? subDomain->findRecursive( restOfDomainPath, maxCreate, wasCreated )
172 subDomain.SetVerbosity( loggerNo, verbosity, priority );
180 subDomain.addLoggerRecursive( logger );
184 Data.erase(
Data.begin() + loggerNo );
186 subDomain.removeLoggerRecursive( loggerNo );
195 for(
size_t i= 0; i <
Data.size() ; ++i ) {
197 tAString.
_(i!=0 ?
", " :
"" )
#define ALIB_ASSERT_ERROR(cond, domain,...)
Domain * Find(NSubstring domainPath, int maxCreate, bool *wasCreated)
void ToString(NAString &target)
Domain(MonoAllocator &allocator, PoolAllocator &pool, const NString &name)
void addLoggerRecursive(detail::Logger *logger)
NString Name
The name of the domain. For root domains, this is nulled.
Domain * Parent
The parent domain. For root domains, this is nullptr.
ListMA< Domain, Recycling::None > SubDomains
A list of subdomains, sorted by name.
Verbosity SetVerbosity(int loggerNo, Verbosity verbosity, Priority priority)
NString FullPath
The full path of the domain (set in the constructor once) .
void removeLoggerRecursive(int loggerNo)
ListPA< std::pair< PrefixLogable *, lang::Inclusion >, Recycling::None > PrefixLogables
Prefix Logables associated with this domain.
static constexpr nchar Separator()
StdVectorMA< LoggerData > Data
Domain * findRecursive(NSubstring &domainPath, int maxCreate, bool *wasCreated)
TAString & _(const TAppendable &src)
integer CopyTo(TChar *dest) const
constexpr integer Length() const
constexpr bool IsEmpty() const
integer IndexOf(TChar needle, integer startIdx=0) const
constexpr bool IsNotEmpty() const
constexpr const TChar * Buffer() const
bool Equals(const TString< TChar > &rhs) const
TSubstring & Split(integer position, TSubstring &target, integer separatorWidth=0, bool trim=false)
constexpr Pair< T1, T2 > MakePair(const T1 &t1, const T2 &t2)
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
strings::TDec< nchar > NDec
Type alias in namespace #"%alib".
strings::TString< nchar > NString
Type alias in namespace #"%alib".
variables::Priority Priority
Type alias in namespace #"%alib".
NLocalString< 1024 > NString1K
Type alias name for #"TLocalString;TLocalString<nchar,1024>".
strings::TAString< nchar, lang::HeapAllocator > NAString
Type alias in namespace #"%alib".
lang::integer integer
Type alias in namespace #"%alib".
monomem::TPoolAllocator< MonoAllocator > PoolAllocator
characters::nchar nchar
Type alias in namespace #"%alib".
strings::TSubstring< nchar > NSubstring
Type alias in namespace #"%alib".
Internal class that holds data stored per Logger.
Verbosity LoggerVerbosity
The verbosity of the Logger for this domain.
int LogCallsPerDomain
the number of log calls on this domain for this logger.
variables::Priority Priority
The priority value that was used to set the verbosity.