10# if !defined (HPP_ALIB_ALOX)
14# define HPP_ALIB_LOX_PROPPERINCLUDE
15# if !defined (HPP_ALOX_DETAIL_DOMAIN)
18# undef HPP_ALIB_LOX_PROPPERINCLUDE
20# if !defined (HPP_ALIB_ALOXMODULE)
24# if !defined (HPP_ALIB_STRINGS_FORMAT)
30namespace alib {
namespace lox {
namespace detail {
41: SubDomains ( allocator )
49 Data .reserve(
static_cast<size_t>( 2 ) );
55 fullPath[name.
Length()]=
'/';
62: SubDomains ( &parent->Data.get_allocator().allocator )
63, Data ( parent->Data.get_allocator().allocator )
68 Name=
Data.get_allocator().allocator.EmplaceString( name );
71 if( parent !=
nullptr )
79 if ( dom !=
this || dom->
Parent ==
nullptr )
84 while( dom !=
nullptr );
85 FullPath=
Data.get_allocator().allocator.EmplaceString( fullPath );
101 if ( wasCreated ==
nullptr )
116 Domain* startDomain=
this;
117 if ( lenBeforeTrim > domainPath.
Length() )
119 while (startDomain->
Parent !=
nullptr )
120 startDomain= startDomain->
Parent;
124 return startDomain->
findRecursive( domainPath, maxCreate, wasCreated );
137 if ( endSubName > 0 )
138 domainPath.
Split<
false>( endSubName, restOfDomainPath, 1 );
141 Domain* subDomain=
nullptr;
144 if( domainPath.
Equals<
false>(
"." ) )
148 else if( domainPath.
Equals<
false>(
".." ) )
155 bool fixedOnce=
false;
163 if( comparison >= 0 )
165 if ( comparison == 0 )
166 subDomain= &(*subDomainIt);
173 if ( subDomain !=
nullptr )
181 bool illegalCharacterFound=
false;
182 for(
int i= 0; i< domainPath.
Length() ; ++i )
184 nchar c= domainPath[i];
186 || ( c >=
'A' && c <=
'Z' )
191 illegalCharacterFound=
true;
193 *
const_cast<nchar*
>( domainPath.
Buffer() + i)=
'#';
197 if ( illegalCharacterFound )
202 if ( maxCreate == 0 )
206 subDomainIt=
SubDomains.Emplace( subDomainIt,
this, domainPath );
208 if ( maxCreate == 0 )
209 return &(*subDomainIt);
216 ? subDomain->
findRecursive( restOfDomainPath, maxCreate, wasCreated )
229 subDomain.SetVerbosity( loggerNo, verbosity, priority );
238 subDomain.addLoggerRecursive( logger );
243 Data.erase(
Data.begin() + loggerNo );
245 subDomain.removeLoggerRecursive( loggerNo );
255 for(
size_t i= 0; i <
Data.size() ; ++i )
258 tAString.
_(i!=0 ?
", " :
"" )
std::vector< LoggerData, StdContMA< LoggerData > > Data
ALIB_API void removeLoggerRecursive(int loggerNo)
List< Domain > SubDomains
ALIB_API Domain(MonoAllocator *allocator, const NString &name)
ALIB_API Verbosity SetVerbosity(int loggerNo, Verbosity verbosity, Priorities priority)
void ToString(NAString &target)
List< std::pair< PrefixLogable *, lang::Inclusion > > PrefixLogables
ALIB_API void addLoggerRecursive(detail::Logger *logger)
Domain * findRecursive(NSubstring &domainPath, int maxCreate, bool *wasCreated)
static constexpr nchar Separator()
ALIB_API Domain * Find(NSubstring domainPath, int maxCreate, bool *wasCreated)
strings::TString< TChar > EmplaceString(const strings::TString< TChar > &src)
ALIB_FORCE_INLINE T * AllocArray(TSize length)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
TAString & InsertAt(const TString< TChar > &src, integer pos)
integer IndexOf(TChar needle, integer startIdx=0) const
constexpr bool IsEmpty() const
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.
Verbosity LoggerVerbosity