10# if !defined(HPP_ALIB_ALOX)
14# if !defined(HPP_ALIB_ALOXMODULE)
18# if !defined(HPP_ALOX_DETAIL_SCOPEINFO)
19# define HPP_ALIB_LOX_PROPPERINCLUDE
21# undef HPP_ALIB_LOX_PROPPERINCLUDE
24# if !defined(HPP_ALIB_LANG_COMMONENUMS)
28# if !defined(HPP_ALIB_ENUMS_SERIALIZATION)
31# if !defined(HPP_ALIB_STRINGS_UTIL_TOKENIZER)
39 #pragma warning( push )
40 #pragma warning( disable : 4127 )
43namespace alib {
namespace lox {
namespace detail {
56: threadDictionary( allocator )
65 ALIB_ASSERT_ERROR( !loxName.Equals<
false>(
"GLOBAL" ),
"ALOX",
"Name \"GLOBAL\" not allowed for Lox instances" )
68 lastSourceFile= &cache[0];
74 std::vector<SourcePathTrimRule>* trimInfoList;
75 for(
int trimInfoNo= 0; trimInfoNo < 2 ; ++trimInfoNo )
78 if ( trimInfoNo == 0 )
80 trimInfoList= &LocalSPTRs;
86 if ( GlobalSPTRsReadFromConfig )
88 GlobalSPTRsReadFromConfig=
true;
90 trimInfoList= &GlobalSPTRs;
95 if( tempVar.
Priority() != Priorities::NONE )
97 for(
int ruleNo= 0; ruleNo < tempVar.
Size(); ++ruleNo )
100 trimInfoList->emplace_back();
106 ruleTknzr.
Actual.ConsumeChars(1);
113 trimInfoList->pop_back();
161 if (
cache[i].origFile.Buffer() == sourceFileName.
Buffer() )
167 if( oldestTime >
cache[i].timeStamp )
192 const NString& trimReplacement,
203 if ( trimOffset == 999999 )
216 std::vector<SourcePathTrimRule>* trimInfoList=
221 auto it= trimInfoList->begin();
222 while( it != trimInfoList->end() && priority < it->Priority )
225 it= trimInfoList->emplace(it);
235 trimInfoList->erase( it );
270 for(
int trimInfoNo= 0; trimInfoNo < 2 ; ++trimInfoNo )
273 std::vector<SourcePathTrimRule>* trimInfoList=
278 for (
auto& ti : *trimInfoList )
343 #pragma warning( pop )
ALIB_API Priorities Load(Variable &variable)
ALIB_API Variable & Declare(const VariableDecl &declaration, const Box &replacements)
const String & GetString(int idx=0)
Priorities Priority() const
config::Configuration & GetConfig()
static ALIB_API bool CurrentDirectory(AString &target)
static ALIB_API int DefaultCacheSize
std::vector< SourcePathTrimRule > LocalSPTRs
static ALIB_API std::vector< SourcePathTrimRule > GlobalSPTRs
ALIB_API ScopeInfo(const NString &name, MonoAllocator *allocator, config::Variable &tempVar)
static ALIB_API bool GlobalSPTRsReadFromConfig
ALIB_API void SetSourcePathTrimRule(const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priorities priority)
SourceFile * lastSourceFile
std::vector< Scope, StdContMA< Scope > > scopes
bool AutoDetectTrimableSourcePath
ALIB_API void Set(const NCString &source, int lineNumber, const NCString &method, threads::Thread *thread)
T * EmplaceArray(TSize length, TArgs &&... args)
strings::TString< TChar > EmplaceString(const strings::TString< TChar > &src)
TAString & ShortenTo(integer newLength)
TAString & DeleteEnd(integer regionLength)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
void DbgDisableBufferReplacementWarning()
ALIB_API integer SearchAndReplace(TChar needle, TChar replacement, integer startIdx=0)
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
static ALIB_API Thread * GetMain()
#define ALIB_IF_THREADS(...)
#define ALIB_WARNINGS_RESTORE
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ALIB_STRINGS_FROM_NARROW( src, dest, bufSize)
#define ALIB_ASSERT(cond)
bool ParseEnumOrTypeBool(strings::TSubstring< TChar > &input, TEnum &result, TEnum falseValue, TEnum trueValue)
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
@ Global
Denotes global reach.
@ Local
Denotes local reach.
constexpr nchar DirectorySeparator
strings::TString< nchar > NString
Type alias in namespace alib.
constexpr NString NullNString()
characters::character character
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
static TChar ToUpper(TChar c)
NString trimmedPathPrefix
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.
Priorities Priority
The priority of the rule. Depends on origin: source code, config...)
NAString Path
The path string.
lang::Case Sensitivity
The sensitivity of the comparison when trimming.
bool IsPrefix
true if path was not starting with '*' when provided.