68 ALIB_ASSERT_ERROR(!result,
"RESOURCES",
"Doubly defined resource \"{}\" in category \"{}\".",
152 #if ALIB_CHARACTERS_WIDE
156 return Get( category, nName
ALIB_DBG(, dbgAssert ) );
161 #if ALIB_DEBUG_RESOURCES
189 std::vector<std::tuple<NString, NString, String, integer>>
DbgGetList();
252 if ( resourceCategory.IsNotNull() )
365 template<
typename TRequires= T>
386 template<
typename TRequires= T>
390 template<
typename TRequires= T>
413 template<
typename TRequires= T>
417 #if ALIB_CHARACTERS_WIDE
418 template<
typename TRequires= T>
452 auto& pf= pool->Get( category, resourceName
ALIB_DBG(,
false) );
538 void Set(
const T& sample) {
582 #if ALIB_CHARACTERS_WIDE
644template<
typename TEnum>
668 auto** lastP = records.getPointerToLast();
669 while( (input= pool.
Get( category, nameNr.
Reset( name).
_(nr)
ALIB_DBG(,
false))).IsNotNull()
677 element->record.Parse();
683 lastP= &element->next;
690 for(
int i= 0 ; i < 35 ; ++i ) {
692 if( pool.
Get( category, nameNr.
Reset( name).
_( nr)
ALIB_DBG(,
false)).IsNotNull() ) {
694 "Detected a \"gap\" in numbering of enum records for type <{}>: "
695 "From index {} to {}.\n Resource: {}/{}",
696 &
typeid(TEnum), nr - i - 1, nr - 1, category, name )
717template<
typename TEnum>
721 "No specialization for ResourcedTraits<TEnum> given. Method not applicable." );
726 innerDelim, outerDelim );
#define ALIB_ERROR(domain,...)
#define ALIB_POP_ALLOWANCE
#define ALIB_ALLOW_NULL_POINTER_PASSING
#define ALIB_ASSERT_ERROR(cond, domain,...)
ResourceHolder(SPResourcePool &pool, const NCString &resourceCategory)
const String & GetResource(const NString &name)
SPResourcePool & GetResourcePoolSP()
const String & TryResource(const NString &name)
NCString ResourceCategory
SPResourcePool resourcePool
Shared pointer to the resource pool.
void BootstrapResource(const NString &name, const String &data)
void Set(SPResourcePool &pool, const NCString &resourceCategory=nullptr)
ResourceHolder(const NCString &resourceCategory=nullptr)
SharedPtr< resources::ResourcePool, MonoAllocator > SPResourcePool
ResourcePool & GetResourcePool()
virtual bool BootstrapAddOrReplace(const NString &category, const NString &name, const String &data)=0
virtual std::vector< std::pair< NString, integer > > DbgGetCategories()
void Bootstrap(const NString &category, const NString &name, const String &data)
const String & Get(const NString &category, const String &name, bool dbgAssert)
virtual ~ResourcePool()=default
Virtual destructor.
virtual const String & Get(const NString &category, const NString &name, bool dbgAssert)=0
virtual void BootstrapBulk(const nchar *category,...)=0
virtual std::vector< std::tuple< NString, NString, String, integer > > DbgGetList()
static T & GetSingleton()
TAString & _(const TAppendable &src)
constexpr bool IsNotNull() const
void Bootstrap(camp::Camp &camp, const NString &name, character innerDelim=',', character outerDelim=',')
void setEnumRecord(const std::type_info &rtti, integer elementValue, const void *record)
TMonoAllocator< lang::HeapAllocator > GLOBAL_ALLOCATOR
strings::TString< nchar > NString
Type alias in namespace #"%alib".
constexpr NString NULL_NSTRING
A nulled string of the narrow character type.
resources::ResourcePool ResourcePool
Type alias in namespace #"%alib".
strings::TCString< nchar > NCString
Type alias in namespace #"%alib".
resources::ResourcedType< T > ResourcedType
Type alias in namespace #"%alib".
constexpr const String EMPTY_STRING
An empty string of the default character type.
lang::integer integer
Type alias in namespace #"%alib".
containers::SharedPtr< T, TAllocator > SharedPtr
Type alias in namespace #"%alib".
strings::TString< character > String
Type alias in namespace #"%alib".
characters::nchar nchar
Type alias in namespace #"%alib".
resources::ResourceInfo ResourceInfo
Type alias in namespace #"%alib".
NLocalString< 256 > NString256
Type alias name for #"TLocalString;TLocalString<nchar,256>".
NLocalString< 128 > NString128
Type alias name for #"TLocalString;TLocalString<nchar,128>".
characters::character character
Type alias in namespace #"%alib".
NLocalString< 64 > NString64
Type alias name for #"TLocalString;TLocalString<nchar,64>".
static void Get(String &result, bool isLastField=false)
static void assertEndOfInput()
static void Initialize(const String &input, character innerDelim, character outerDelim, const NString &resourceCategory, const NString &resourceName)
A node of the forward list that contains the custom record data.
ResourceInfo(const T &sample)
NString Category
The resource category within #".Pool".
ResourcePool * Pool
The resource pool.
void Set(const T &sample)
ResourceInfo() noexcept=default
Defaulted constructor leaving the fields uninitialized.
NString Name
The resource category within #".Pool".
const String & Get(const String &name, bool dbgAssert)
void Set(resources::ResourcePool *pool, NString category, NString name)
const String & Get(const NString &name, bool dbgAssert)
static constexpr NString Category()
static constexpr NString Name()
static constexpr ResourcePool * Pool()
static const String & Get()
static const String & Get(const String &resourceName, bool dbgAssert)
static const String & TypeNamePostfix()
static const String & Get(const NString &name, bool dbgAssert)
static const String & TypeNamePrefix()