14#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
15# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
57:
Name (allocator, name)
63 Data .reserve(
size_t( 2 ) );
68 fullPath[name.
Length()]=
'/';
74:
Name( parent->
Data.get_allocator().GetAllocator(), name )
77,
Data ( parent->
Data.get_allocator().GetAllocator() )
81 if( parent !=
nullptr )
89 if ( dom != this || dom->Parent == nullptr )
90 fullPath.InsertAt(
"/" , 0 );
91 fullPath.InsertAt( dom->Name, 0 );
94 while( dom !=
nullptr );
95 FullPath.Allocate(
Data.get_allocator().GetAllocator(), fullPath );
105 if ( wasCreated ==
nullptr )
120 Domain* startDomain=
this;
121 if ( lenBeforeTrim > domainPath.
Length() )
123 while (startDomain->
Parent !=
nullptr )
124 startDomain= startDomain->
Parent;
128 return startDomain->
findRecursive( domainPath, maxCreate, wasCreated );
137 ALIB_ASSERT_ERROR( endSubName != 0,
"ALOX",
"Internal error. This must never happen." )
141 if ( endSubName > 0 )
142 domainPath.
Split<
NC>( endSubName, restOfDomainPath, 1 );
145 Domain* subDomain=
nullptr;
152 else if( domainPath.
Equals<
NC>(
".." ) )
159 bool fixedOnce=
false;
167 if( comparison >= 0 )
169 if ( comparison == 0 )
170 subDomain= &(*subDomainIt);
177 if ( subDomain !=
nullptr )
185 bool illegalCharacterFound=
false;
186 for(
int i= 0; i< domainPath.
Length() ; ++i )
188 nchar c= domainPath[i];
190 || ( c >=
'A' && c <=
'Z' )
195 illegalCharacterFound=
true;
197 *
const_cast<nchar*
>( domainPath.
Buffer() + i)=
'#';
201 if ( illegalCharacterFound )
206 if ( maxCreate == 0 )
210 subDomainIt=
SubDomains.emplace( subDomainIt,
this, domainPath );
212 if ( maxCreate == 0 )
213 return &(*subDomainIt);
220 ? subDomain->findRecursive( restOfDomainPath, maxCreate, wasCreated )
233 subDomain.SetVerbosity( loggerNo, verbosity, priority );
242 subDomain.addLoggerRecursive( logger );
247 Data.erase(
Data.begin() + loggerNo );
249 subDomain.removeLoggerRecursive( loggerNo );
259 for(
size_t i= 0; i <
Data.size() ; ++i )
262 tAString.
_(i!=0 ?
", " :
"" )
List< PoolAllocator, std::pair< PrefixLogable *, lang::Inclusion >, Recycling::None > PrefixLogables
Prefix Logables associated with this domain.
StdVectorMono< LoggerData > Data
ALIB_DLL Domain * Find(NSubstring domainPath, int maxCreate, bool *wasCreated)
void ToString(NAString &target)
ALIB_DLL Domain(MonoAllocator &allocator, PoolAllocator &pool, const NString &name)
ALIB_DLL 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.
List< MonoAllocator, Domain, Recycling::None > SubDomains
A list of subdomains, sorted by name.
ALIB_DLL Verbosity SetVerbosity(int loggerNo, Verbosity verbosity, Priority priority)
NString FullPath
The full path of the domain (set in the constructor once) .
ALIB_DLL void removeLoggerRecursive(int loggerNo)
static constexpr nchar Separator()
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)
#define ALIB_ASSERT_ERROR(cond, domain,...)
constexpr Pair< T1, T2 > MakePair(const T1 &t1, const T2 &t2)
strings::TDec< nchar > NDec
Type alias in namespace alib.
strings::TSubstring< nchar > NSubstring
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
monomem::TPoolAllocator< MonoAllocator > PoolAllocator
strings::TString< nchar > NString
Type alias in namespace alib.
NLocalString< 1024 > NString1K
Type alias name for TLocalString<nchar,1024>.
strings::TAString< nchar, lang::HeapAllocator > NAString
Type alias in namespace alib.
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
alib::variables::Priority Priority
Type alias in namespace alib.
characters::nchar nchar
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.