12# define HPP_ALIB_LOX_PROPPERINCLUDE
14# undef HPP_ALIB_LOX_PROPPERINCLUDE
23 #pragma warning( push )
24 #pragma warning( disable : 4127 )
29namespace alib {
namespace lox {
namespace detail {
40: threadDictionary (allocator)
45 parsedFileNameCache(allocator, 4, 6)
46, callStack (allocator)
47, loxName (allocator, pName)
51 ALIB_ASSERT_ERROR( !loxName.Equals<
NC>(
"GLOBAL" ),
"ALOX",
"Name \"GLOBAL\" not allowed for Lox instances" )
57 std::vector<SourcePathTrimRule>* trimInfoList;
58 for(
int trimInfoNo= 0; trimInfoNo < 2 ; ++trimInfoNo )
63 if ( trimInfoNo == 0 )
65 trimInfoList= &LocalSPTRs;
71 if ( GlobalSPTRsReadFromConfig )
73 GlobalSPTRsReadFromConfig=
true;
75 trimInfoList= &GlobalSPTRs;
82 tokOuter.
Set(variable,
';',
true);
86 trimInfoList->emplace_back();
92 ruleTknzr.
Actual.ConsumeChars(1);
99 trimInfoList->pop_back();
131 if( resultPair.first ==
false )
132 resultPair.second.Construct(ci.
File);
133 scope.
Parsed = &*resultPair.second;
146 const NString& trimReplacement,
154 if ( trimOffset == 999999 )
167 std::vector<SourcePathTrimRule>* trimInfoList=
172 auto it= trimInfoList->begin();
173 while( it != trimInfoList->end() && priority < it->
Priority )
176 it= trimInfoList->emplace(it);
186 trimInfoList->erase( it );
221 for(
int trimInfoNo= 0; trimInfoNo < 2 ; ++trimInfoNo )
224 std::vector<SourcePathTrimRule>* trimInfoList=
229 for (
auto& ti : *trimInfoList )
262 Path currentDir(SystemFolders::Current);
291 #pragma warning( pop )
ALIB_API Variable & Declare(const String &name, const String &typeName, const String &defaultValue=NULL_STRING)
Priority GetPriority() const
threads::SharedLock & GetConfigLock()
std::vector< SourcePathTrimRule > LocalSPTRs
List of trim definitions for portions of source paths to be ignored.
StdVectorMono< FrameRecord > callStack
A stack of scopes (allows recursive calls/nested logging).
static ALIB_API std::vector< SourcePathTrimRule > GlobalSPTRs
List of trim definitions for portions of source paths to be ignored.
static ALIB_API bool GlobalSPTRsReadFromConfig
Flag to determine if global rules have been read from config already.
Thread * thread
The thread passed with Set.
ALIB_API void Set(const lang::CallerInfo &ci)
std::thread::id threadNativeIDx
The C++ native ID.
int callStackSize
The current depth of recursive invocations.
ALIB_API void SetSourcePathTrimRule(const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priority priority)
String threadName
The name of the thread that executed the log.
bool AutoDetectTrimableSourcePath
LRUCacheTable< MonoAllocator, ValueDescriptorPFN, std::hash< NString > > parsedFileNameCache
Least recently used cache of parsed file name.
ALIB_API ScopeInfo(const NString &name, MonoAllocator &allocator)
TAString & ShortenTo(integer newLength)
ALIB_API integer SearchAndReplace(TChar needle, TChar replacement, integer startIdx=0, integer endIdx=strings::MAX_LEN)
TAString & DeleteEnd(integer regionLength)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
integer IndexOf(TChar needle, integer startIdx=0) const
constexpr bool IsEmpty() const
constexpr integer Length() const
TChar CharAtStart() const
TString< TChar > Substring(integer regionStart, integer regionLength=MAX_LEN) const
bool StartsWith(const TString &needle) const
constexpr const TChar * Buffer() const
ALIB_API TSubstring< TChar > & Next(lang::Whitespaces trimming=lang::Whitespaces::Trim, TChar newDelim='\0')
TSubstring< TChar > Actual
void Set(const TString< TChar > &src, TChar delimiter, bool skipEmptyTokens=false)
static ALIB_API Thread * GetMain()
#define IF_ALIB_THREADS(...)
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_PATH_TO_NARROW( src, dest, bufSize)
#define ALIB_LOCK_WITH(lock)
#define ALIB_STRINGS_FROM_NARROW( src, dest, bufSize)
#define ALIB_ASSERT(cond)
bool ParseEnumOrTypeBool(strings::TSubstring< TChar > &input, TEnum &result, TEnum falseValue, TEnum trueValue)
This is the reference documentation of sub-namespace system of module ALib BaseCamp.
static constexpr PathCharType DIRECTORY_SEPARATOR
The standard path separator character. Defaults to '\' on Windows OS, '/' else.
Inclusion
Denotes how members of a set something should be taken into account.
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
Reach
Denotes the reach of something.
@ Global
Denotes global reach.
@ Local
Denotes local reach.
Case
Denotes upper and lower case character treatment.
@ SPTR_GLOBAL
Denotes configuration variable ALOX/GLOBAL_SOURCE_PATH_TRIM_RULES.
@ SPTR_LOX
Denotes configuration variable ALOX/LOXNAME/SOURCE_PATH_TRIM_RULES used by class Lox.
lox::ALoxCamp ALOX
The singleton instance of ALib Camp class ALoxCamp.
constexpr NString NULL_NSTRING
A nulled string of the narrow character type.
strings::TString< nchar > NString
Type alias in namespace alib.
characters::character character
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
const char * File
The name of the source file as given by compiler.
int Line
The line number within File.
Ticks timeStamp
Time of the call that created this record.
ParsedFileName * Parsed
The entry from the parsedFileNameCache.
NCString origMethod
Function/method name (given by the C++ preprocessor)
int origLine
Line number within the source file (given by the C++ preprocessor)
Information of a single source file. Stored in field parsedFileNameCache.
NString trimmedPathPrefix
NCString origFile
Path and name of source file (given by the C++ preprocessor).
NString trimmedPath
Trimmed path of source file (evaluated).
NAString TrimReplacement
Optional replacement string for trimmed paths.
int TrimOffset
Additional offset of the trim position.
lang::Inclusion IncludeString
Denotes if Path itself should be included when trimmed.
NAString Path
The path string.
lang::Case Sensitivity
The sensitivity of the comparison when trimming.
config::Priority Priority
The priority of the rule. Depends on origin: source code, config...)
bool IsPrefix
true if path was not starting with '*', when provided.