Cogs.Foundation
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Cogs Namespace Reference

Main Cogs namespace. More...

Namespaces

namespace  Collections
 Contains collection classes used to manage object storage.
 
namespace  ComponentModel
 Contains code for composing and managing entities built from components.
 
namespace  Details
 
namespace  EasingFn
 
namespace  Geometry
 
namespace  IO
 
namespace  Logging
 Contains logging functionality for the Cogs native library.
 
namespace  Memory
 
namespace  Network
 
namespace  Reflection
 Contains reflection support.
 
namespace  Threads
 

Classes

struct  DirectoryEntry
 
struct  FileContents
 Abstract base class storing data read from a file. More...
 
struct  FileEntry
 
class  FileHandle
 
class  FileSystemWatcher
 
struct  Gesture
 
class  Gestures
 
class  ImmutableString
 Represents a non-copyable immutable string. More...
 
class  Interpolator
 
struct  IntrusiveList
 
struct  IntrusiveNode
 
struct  Item
 
class  Keyboard
 
class  LLToENUConverter
 Converts WGS latitude-longitude coordinates to ENU local tangential east-north-up coordinate system. More...
 
struct  MemoryBufferBackedFileContents
 
struct  MMapBackedFileContents
 
class  Module
 Base class for managing libraries dynamically loaded at runtime. More...
 
class  ModuleAPI
 Helper class for shared libraries that implement the getPublicAPI function and provide a structure of function pointers that contain the module's public API. More...
 
class  Monitor
 Helper class for enumerating available displays on the host computer. More...
 
class  Mouse
 
class  PlatformContext
 
struct  Pointer
 Provides scoped storage for a raw pointer and corresponding deletion logic. More...
 
struct  Storage
 
class  StringView
 Provides a weakly referenced view over the contents of a string. More...
 
class  Timer
 Old timer class. More...
 
struct  UniqueValue
 A value that is cleared when it is moved from. More...
 
struct  WindowData
 

Typedefs

using ComponentIndex = uint32_t
 Type used to track component indexes in pools.
 
using SizeType = ComponentIndex
 Type used to track the size of pools.
 
template<typename T >
using Atomic = std::atomic< T >
 
using PointerId = size_t
 
typedef std::thread Thread
 
typedef std::mutex Mutex
 
typedef std::lock_guard< MutexLockGuard
 
typedef std::unique_lock< MutexUniqueLock
 
template<typename T >
using Future = std::future< T >
 
typedef int64_t TimePerf
 
typedef int64_t Time
 

Enumerations

enum struct  FileContentsHints : uint32_t { None = 0 , ZStdDecompress = 1 << 0 , BrotliDecompress = 1 << 1 }
 
enum class  PointerType { Mouse , Touch , Count , Unknown }
 
enum class  Key {
  A , B , C , D ,
  E , F , G , H ,
  I , J , K , L ,
  M , N , O , P ,
  Q , R , S , T ,
  U , V , W , X ,
  Y , Z , Zero , One ,
  Two , Three , Four , Five ,
  Six , Seven , Eight , Nine ,
  Left , Right , Up , Down ,
  Shift , LeftShift , RightShift , Control ,
  LeftControl , RightControl , Alt , LeftAlt ,
  RightAlt , CapsLock , Tab , Escape ,
  Enter , Space , Insert , Delete ,
  Backspace , Home , End , PageUp ,
  PageDown , F1 , F2 , F3 ,
  F4 , F5 , F6 , F7 ,
  F8 , F9 , F10 , F11 ,
  F12 , Count , None = -1
}
 
enum  MouseButton : int {
  Left , Right , Middle , Count ,
  NoButton
}
 

Functions

constexpr uint64_t mortonCode (uint16_t i, uint16_t j, uint16_t k)
 Interleave bits of 3 values to form the 3-way Morton code.
 
constexpr uint32_t mortonCode (uint16_t a, uint16_t b)
 Interleave bits of 2 values.
 
template<typename T >
bool isPowerOfTwo (T x)
 
uint8_t roundUpToPowerOfTwo (uint8_t x)
 
uint16_t roundUpToPowerOfTwo (uint16_t x)
 
uint16_t roundDownToPowerOfTwo (uint16_t x)
 
uint32_t roundUpToPowerOfTwo (uint32_t x)
 
uint64_t roundUpToPowerOfTwo (uint64_t x)
 
uint8_t roundUpToPowerOfTwoShift (uint8_t x)
 
uint16_t roundUpToPowerOfTwoShift (uint16_t x)
 
uint32_t roundUpToPowerOfTwoShift (uint32_t x)
 
uint64_t roundUpToPowerOfTwoShift (uint64_t x)
 
template<typename ClassType , typename FieldType >
size_t memberOffset (FieldType ClassType::*ptr)
 Find the offset of a pointer to member in a class or struct.
 
constexpr uint32_t make2CCLE (uint8_t a, uint8_t b)
 
constexpr uint32_t make2CCBE (uint8_t a, uint8_t b)
 
constexpr uint32_t make4CCLE (uint8_t a, uint8_t b, uint8_t c, uint8_t d)
 
constexpr uint32_t make4CCBE (uint8_t a, uint8_t b, uint8_t c, uint8_t d)
 
const char * getFoundationVersionString ()
 
template<typename T >
T interpolateFn (const T &s, const T &d, float t)
 
template<>
glm::quat interpolateFn< glm::quat > (const glm::quat &s, const glm::quat &d, float t)
 
COGSFOUNDATION_API size_t murmur2 (const void *bytes, const size_t length) noexcept
 Implementation of the MurmurHash2 algorithm.
 
constexpr size_t fnv1a (uint8_t data, size_t hashValue) noexcept
 Hashes a single byte using the fnv1a algorithm.
 
constexpr size_t fnv1a (const void *bytes, size_t length, size_t hashValue=Details::FNV_offset_basis) noexcept
 Implementation of the FNV-1a algorithm for a block of memory.
 
constexpr size_t hash () noexcept
 Simple getter function that returns the initial value for fnv1a hashing.
 
template<typename T , typename std::enable_if< std::is_integral< T >::value||std::is_enum< T >::value||std::is_floating_point< T >::value, int >::type * = nullptr>
constexpr size_t hash (T data, size_t hashValue=hash()) noexcept
 Hash function for integer and floating point types. (And enums.)
 
constexpr size_t hash (const char *str, size_t hashValue=hash()) noexcept
 Hash function for hashing Null terminated C character strings.
 
COGSFOUNDATION_API size_t hashLowercase (std::string_view str, size_t hashValue=Cogs::hash()) noexcept
 Get the hash code of the string converted to lowercase.
 
constexpr size_t hash (const void *mem, size_t size, size_t hashValue=hash()) noexcept
 Hash a non-descript block of memory.
 
constexpr size_t hash (std::string_view str, size_t hashValue=hash()) noexcept
 Generic hash function specialization for strings (std::string, std::string_view, Cogs::StringView).
 
template<typename T , typename U >
constexpr size_t hashSequence (const T &t, const U &u)
 Hash the last two items in a sequence of objects.
 
template<typename T , typename U , typename... Args>
constexpr size_t hashSequence (const T &t, const U &u, Args... args)
 Calculates a single hash value from a sequence of objects.
 
COGSFOUNDATION_API void * stbAlloc (size_t size, void *userData=nullptr)
 
COGSFOUNDATION_API void * stbRealloc (void *ptr, size_t oldSize, size_t newSize)
 
COGSFOUNDATION_API void stbFree (void *ptr, void *userData=nullptr)
 
COGSFOUNDATION_API bool isBeingDebugged ()
 Return true if the application is running under a debugger.
 
COGSFOUNDATION_API std::string getCallstack ()
 Returns the current callstack as a string.
 
COGSFOUNDATION_API TimePerf perfTime ()
 High resolution performance timer. Returns an implementation defined absolute timestamp, can be subtracted to get a time duration.
 
COGSFOUNDATION_API Time currentTime ()
 High resolution clock time (NTP / UTC time). Returns an implementation defined absolute timestamp, can be subtracted to get a time duration.
 
COGSFOUNDATION_API TimePerf perfTimeReference ()
 Functions that provide a reference time point at the start of the application startup. Useful for application uptime or converting absolute timestamps to a narrow value range.
 
COGSFOUNDATION_API Time currentTimeReference ()
 
COGSFOUNDATION_API int64_t perfTimeToMicroseconds (TimePerf time)
 Convertion functions for timestamps.
 
COGSFOUNDATION_API int64_t perfTimeToMilliseconds (TimePerf time)
 
COGSFOUNDATION_API double perfTimeToSeconds (TimePerf time)
 
COGSFOUNDATION_API int64_t currentTimeToMicroseconds (Time time)
 
COGSFOUNDATION_API int64_t currentTimeToMilliseconds (Time time)
 
COGSFOUNDATION_API double currentTimeToSeconds (Time time)
 
template<typename T , typename DeleterFunction >
Pointer< TmakePointer (T *t, DeleterFunction deleterFunc)
 Construct a Pointer<T> instance from the given pointer and deleter function.
 
std::ostream & operator<< (std::ostream &stream, const Cogs::StringView &stringView)
 Stream operator out provided to make it possible to insert Cogs::StringView into streams.
 
std::string & stringReplaceAll (std::string &str, std::string_view from, std::string_view to)
 
bool stringStartsWith (std::string_view str, std::string_view beginning)
 
bool stringEndsWith (std::string_view str, std::string_view ending)
 
std::string stringToLower (std::string_view input)
 
std::string stringToUpper (std::string_view input)
 
std::string stringConcatenate (std::initializer_list< std::string_view > strList)
 
std::string stringJoin (std::string_view separator, std::initializer_list< std::string_view > strList)
 
bool operator< (const StringView &left, const StringView &right) noexcept
 Lexicographically compare two string views.
 
bool operator> (const StringView &left, const StringView &right) noexcept
 Lexicographically compare two string views.
 
bool operator<= (const StringView &left, const StringView &right) noexcept
 Lexicographically compare two string views.
 
bool operator>= (const StringView &left, const StringView &right) noexcept
 Lexicographically compare two string views.
 
bool operator== (const char *left, const StringView &right) noexcept
 Char ptr equality operator.
 
bool operator== (const StringView &left, const char *right) noexcept
 Char ptr equality operator.
 
bool operator== (const std::string &left, const StringView &right) noexcept
 std::string equality operator.
 
bool operator== (const std::string_view &left, const StringView &right) noexcept
 std::string_view equality operator.
 

Variables

constexpr Cogs::Logging::Log logger = Cogs::Logging::getLogger("FileSystemWatcher")
 

Detailed Description

Main Cogs namespace.

Define we can check on if size_t literal suffix is defined.

Hashing functions for COGS.

DO NOT mix these hashing functions with STL std::hash for same data types. DO NOT serialize hash values. 32 and 64 bit incompatible. No guarantee for backwards compatibility.

Typedef Documentation

◆ Atomic

template<typename T >
using Cogs::Atomic = typedef std::atomic<T>

◆ ComponentIndex

using Cogs::ComponentIndex = typedef uint32_t

Type used to track component indexes in pools.

◆ Future

template<typename T >
using Cogs::Future = typedef std::future<T>

◆ LockGuard

typedef std::lock_guard<Mutex> Cogs::LockGuard

◆ Mutex

typedef std::mutex Cogs::Mutex

◆ PointerId

using Cogs::PointerId = typedef size_t

◆ SizeType

using Cogs::SizeType = typedef ComponentIndex

Type used to track the size of pools.

◆ Thread

typedef std::thread Cogs::Thread

◆ Time

typedef int64_t Cogs::Time

◆ TimePerf

typedef int64_t Cogs::TimePerf

◆ UniqueLock

typedef std::unique_lock<Mutex> Cogs::UniqueLock

Enumeration Type Documentation

◆ FileContentsHints

enum struct Cogs::FileContentsHints : uint32_t
strong
Enumerator
None 
ZStdDecompress 

A hint that the contents are Zstandard (Facebook) compressed and is allowed to be decompressed during transfer if this flag is removed.

BrotliDecompress 

A hint that the contents are Brotli (Google) compressed and is allowed to be decompressed during transfer if this flag is removed.

◆ Key

enum class Cogs::Key
strong
Enumerator
Zero 
One 
Two 
Three 
Four 
Five 
Six 
Seven 
Eight 
Nine 
Left 
Right 
Up 
Down 
Shift 
LeftShift 
RightShift 
Control 
LeftControl 
RightControl 
Alt 
LeftAlt 
RightAlt 
CapsLock 
Tab 
Escape 
Enter 
Space 
Insert 
Delete 
Backspace 
Home 
End 
PageUp 
PageDown 
F1 
F2 
F3 
F4 
F5 
F6 
F7 
F8 
F9 
F10 
F11 
F12 
Count 
None 

◆ MouseButton

enum Cogs::MouseButton : int
Enumerator
Left 
Right 
Middle 
Count 
NoButton 

◆ PointerType

enum class Cogs::PointerType
strong
Enumerator
Mouse 
Touch 
Count 
Unknown 

Function Documentation

◆ currentTime()

Cogs::Time Cogs::currentTime ( )

High resolution clock time (NTP / UTC time). Returns an implementation defined absolute timestamp, can be subtracted to get a time duration.

Referenced by Cogs::Timer::currentTimeMicroseconds(), and Cogs::Timer::currentTimeMilliseconds().

◆ currentTimeReference()

Cogs::Time Cogs::currentTimeReference ( )

◆ currentTimeToMicroseconds()

int64_t Cogs::currentTimeToMicroseconds ( Time  time)

◆ currentTimeToMilliseconds()

int64_t Cogs::currentTimeToMilliseconds ( Time  time)

◆ currentTimeToSeconds()

double Cogs::currentTimeToSeconds ( Time  time)

◆ fnv1a() [1/2]

constexpr size_t Cogs::fnv1a ( const void *  bytes,
size_t  length,
size_t  hashValue = Details::FNV_offset_basis 
)
constexprnoexcept

Implementation of the FNV-1a algorithm for a block of memory.

See also
https://en.wikipedia.org/wiki/Fowler-Noll-Vo_hash_function
Parameters
bytesPointer to a sequence of bytes.
lengthThe number of bytes in the sequence.
hashValueInitial hash value to be used. This allows you to chain hash calls together.
Returns
A size_t containing the computed hash value.

References fnv1a().

◆ fnv1a() [2/2]

constexpr size_t Cogs::fnv1a ( uint8_t  data,
size_t  hashValue 
)
constexprnoexcept

Hashes a single byte using the fnv1a algorithm.

References Cogs::Details::FNV_prime.

Referenced by fnv1a(), and hash().

◆ getCallstack()

COGSFOUNDATION_API std::string Cogs::getCallstack ( )

Returns the current callstack as a string.

◆ getFoundationVersionString()

const char * Cogs::getFoundationVersionString ( )

◆ hash() [1/5]

constexpr size_t Cogs::hash ( )
constexprnoexcept

◆ hash() [2/5]

constexpr size_t Cogs::hash ( const char *  str,
size_t  hashValue = hash() 
)
constexprnoexcept

Hash function for hashing Null terminated C character strings.

References fnv1a().

◆ hash() [3/5]

constexpr size_t Cogs::hash ( const void *  mem,
size_t  size,
size_t  hashValue = hash() 
)
constexprnoexcept

Hash a non-descript block of memory.

References fnv1a().

◆ hash() [4/5]

constexpr size_t Cogs::hash ( std::string_view  str,
size_t  hashValue = hash() 
)
constexprnoexcept

Generic hash function specialization for strings (std::string, std::string_view, Cogs::StringView).

References fnv1a().

◆ hash() [5/5]

template<typename T , typename std::enable_if< std::is_integral< T >::value||std::is_enum< T >::value||std::is_floating_point< T >::value, int >::type * = nullptr>
constexpr size_t Cogs::hash ( T  data,
size_t  hashValue = hash() 
)
constexprnoexcept

Hash function for integer and floating point types. (And enums.)

References fnv1a().

◆ hashLowercase()

size_t Cogs::hashLowercase ( std::string_view  str,
size_t  hashValue = Cogs::hash() 
)
noexcept

Get the hash code of the string converted to lowercase.

Lowercase is here defined as default "C" locale, i.e., A-Z is converted to a-z.

Returns
Hash code.

References hash().

Referenced by Cogs::StringView::hashLowercase(), and Cogs::Logging::parseCategoryString().

◆ hashSequence() [1/2]

template<typename T , typename U >
constexpr size_t Cogs::hashSequence ( const T t,
const U u 
)
constexpr

Hash the last two items in a sequence of objects.

References hash().

Referenced by Cogs::Logging::ThrottledConsumer::consumeMessage(), and hashSequence().

◆ hashSequence() [2/2]

template<typename T , typename U , typename... Args>
constexpr size_t Cogs::hashSequence ( const T t,
const U u,
Args...  args 
)
constexpr

Calculates a single hash value from a sequence of objects.

References hash(), and hashSequence().

◆ interpolateFn()

template<typename T >
T Cogs::interpolateFn ( const T s,
const T d,
float  t 
)
inline

◆ interpolateFn< glm::quat >()

template<>
glm::quat Cogs::interpolateFn< glm::quat > ( const glm::quat &  s,
const glm::quat &  d,
float  t 
)
inline

◆ isBeingDebugged()

COGSFOUNDATION_API bool Cogs::isBeingDebugged ( )

Return true if the application is running under a debugger.

Referenced by Cogs::Logging::ConsoleLogger::ConsoleLogger().

◆ isPowerOfTwo()

template<typename T >
bool Cogs::isPowerOfTwo ( T  x)
inline

Returns true if x is a power of two.

Note
Zero is considered a power of two.

Referenced by Cogs::Collections::FixedIndexQueue< Element, IndexBaseType >::resize().

◆ make2CCBE()

constexpr uint32_t Cogs::make2CCBE ( uint8_t  a,
uint8_t  b 
)
constexpr

◆ make2CCLE()

constexpr uint32_t Cogs::make2CCLE ( uint8_t  a,
uint8_t  b 
)
constexpr

◆ make4CCBE()

constexpr uint32_t Cogs::make4CCBE ( uint8_t  a,
uint8_t  b,
uint8_t  c,
uint8_t  d 
)
constexpr

◆ make4CCLE()

constexpr uint32_t Cogs::make4CCLE ( uint8_t  a,
uint8_t  b,
uint8_t  c,
uint8_t  d 
)
constexpr

◆ makePointer()

template<typename T , typename DeleterFunction >
Pointer< T > Cogs::makePointer ( T t,
DeleterFunction  deleterFunc 
)

Construct a Pointer<T> instance from the given pointer and deleter function.

Allows simple template type deduction for the T parameter.

Template Parameters
TType of the pointer given.
DeleterFunctionType of deleter to associate with the pointer.
Parameters
tPointer to store.
deleterFuncDeleter function instance.
Returns
A initialized Pointer<T> instance.

◆ memberOffset()

template<typename ClassType , typename FieldType >
size_t Cogs::memberOffset ( FieldType ClassType::*  ptr)
inline

Find the offset of a pointer to member in a class or struct.

The offset is found by constructing a member pointer inside an instance of the type at memory address zero. The pointers address can then be directly converted to a byte offset from the start of the instance.

Referenced by Cogs::ComponentModel::Component::getFieldId(), and Cogs::Reflection::Type::getFieldId().

◆ mortonCode() [1/2]

constexpr uint32_t Cogs::mortonCode ( uint16_t  a,
uint16_t  b 
)
constexpr

Interleave bits of 2 values.

◆ mortonCode() [2/2]

constexpr uint64_t Cogs::mortonCode ( uint16_t  i,
uint16_t  j,
uint16_t  k 
)
constexpr

Interleave bits of 3 values to form the 3-way Morton code.

References I, J, and K.

◆ murmur2()

size_t Cogs::murmur2 ( const void *  bytes,
const size_t  length 
)
noexcept

Implementation of the MurmurHash2 algorithm.

See also
http://en.wikipedia.org/wiki/MurmurHash
Parameters
bytesPointer to a sequence of bytes.
lengthLength of the sequence of bytes to operate on.
Returns
A size_t containing the computed hash value.

◆ operator<()

bool Cogs::operator< ( const StringView left,
const StringView right 
)
inlinenoexcept

Lexicographically compare two string views.

◆ operator<<()

std::ostream & Cogs::operator<< ( std::ostream &  stream,
const Cogs::StringView stringView 
)
inline

Stream operator out provided to make it possible to insert Cogs::StringView into streams.

Parameters
streamStream object to output to.
stringViewStringView instance to output.
Returns
A reference to the given stream. Allows chaining of output.

◆ operator<=()

bool Cogs::operator<= ( const StringView left,
const StringView right 
)
inlinenoexcept

Lexicographically compare two string views.

◆ operator==() [1/4]

bool Cogs::operator== ( const char *  left,
const StringView right 
)
inlinenoexcept

Char ptr equality operator.

◆ operator==() [2/4]

bool Cogs::operator== ( const std::string &  left,
const StringView right 
)
inlinenoexcept

std::string equality operator.

◆ operator==() [3/4]

bool Cogs::operator== ( const std::string_view &  left,
const StringView right 
)
inlinenoexcept

std::string_view equality operator.

◆ operator==() [4/4]

bool Cogs::operator== ( const StringView left,
const char *  right 
)
inlinenoexcept

Char ptr equality operator.

◆ operator>()

bool Cogs::operator> ( const StringView left,
const StringView right 
)
inlinenoexcept

Lexicographically compare two string views.

◆ operator>=()

bool Cogs::operator>= ( const StringView left,
const StringView right 
)
inlinenoexcept

Lexicographically compare two string views.

◆ perfTime()

Cogs::TimePerf Cogs::perfTime ( )

High resolution performance timer. Returns an implementation defined absolute timestamp, can be subtracted to get a time duration.

Referenced by Cogs::Timer::elapsedMicroseconds(), Cogs::Timer::elapsedMilliseconds(), Cogs::Timer::elapsedSeconds(), Cogs::Timer::start(), and Cogs::Timer::stop().

◆ perfTimeReference()

Cogs::TimePerf Cogs::perfTimeReference ( )

Functions that provide a reference time point at the start of the application startup. Useful for application uptime or converting absolute timestamps to a narrow value range.

◆ perfTimeToMicroseconds()

int64_t Cogs::perfTimeToMicroseconds ( TimePerf  time)

Convertion functions for timestamps.

Referenced by Cogs::Timer::elapsedMicroseconds().

◆ perfTimeToMilliseconds()

int64_t Cogs::perfTimeToMilliseconds ( TimePerf  time)

◆ perfTimeToSeconds()

double Cogs::perfTimeToSeconds ( TimePerf  time)

◆ roundDownToPowerOfTwo()

uint16_t Cogs::roundDownToPowerOfTwo ( uint16_t  x)
inline

◆ roundUpToPowerOfTwo() [1/4]

uint16_t Cogs::roundUpToPowerOfTwo ( uint16_t  x)
inline

Round a number up to the next number of two, or return itself if the number already is a power of two.

Note
Zero is considered a power of two.

◆ roundUpToPowerOfTwo() [2/4]

uint32_t Cogs::roundUpToPowerOfTwo ( uint32_t  x)
inline

Round a number up to the next number of two, or return itself if the number already is a power of two.

Note
Zero is considered a power of two.

◆ roundUpToPowerOfTwo() [3/4]

uint64_t Cogs::roundUpToPowerOfTwo ( uint64_t  x)
inline

Round a number up to the next number of two, or return itself if the number already is a power of two.

Note
Zero is considered a power of two.

◆ roundUpToPowerOfTwo() [4/4]

uint8_t Cogs::roundUpToPowerOfTwo ( uint8_t  x)
inline

Round a number up to the next number of two, or return itself if the number already is a power of two.

Note
Zero is considered a power of two.

Referenced by roundUpToPowerOfTwoShift().

◆ roundUpToPowerOfTwoShift() [1/4]

uint16_t Cogs::roundUpToPowerOfTwoShift ( uint16_t  x)
inline

Rounds x up to the next number of two if it is not already a number of two and returns the number of shifts this number is.

Note
Zero is considered a power of two.

References roundUpToPowerOfTwo().

◆ roundUpToPowerOfTwoShift() [2/4]

uint32_t Cogs::roundUpToPowerOfTwoShift ( uint32_t  x)
inline

Rounds x up to the next number of two if it is not already a number of two and returns the number of shifts this number is.

Note
Zero is considered a power of two.

References roundUpToPowerOfTwo().

◆ roundUpToPowerOfTwoShift() [3/4]

uint64_t Cogs::roundUpToPowerOfTwoShift ( uint64_t  x)
inline

Rounds x up to the next number of two if it is not already a number of two and returns the number of shifts this number is.

Note
Zero is considered a power of two.

References roundUpToPowerOfTwo().

◆ roundUpToPowerOfTwoShift() [4/4]

uint8_t Cogs::roundUpToPowerOfTwoShift ( uint8_t  x)
inline

Rounds x up to the next number of two if it is not already a number of two and returns the number of shifts this number is.

Note
Zero is considered a power of two.

References roundUpToPowerOfTwo().

Referenced by Cogs::Collections::FixedIndexQueue< Element, IndexBaseType >::shrink().

◆ stbAlloc()

void * Cogs::stbAlloc ( size_t  size,
void *  userData = nullptr 
)

◆ stbFree()

void Cogs::stbFree ( void *  ptr,
void *  userData = nullptr 
)

◆ stbRealloc()

void * Cogs::stbRealloc ( void *  ptr,
size_t  oldSize,
size_t  newSize 
)

◆ stringConcatenate()

COGSFOUNDATION_API std::string Cogs::stringConcatenate ( std::initializer_list< std::string_view >  strList)

◆ stringEndsWith()

bool Cogs::stringEndsWith ( std::string_view  str,
std::string_view  ending 
)
inline

◆ stringJoin()

COGSFOUNDATION_API std::string Cogs::stringJoin ( std::string_view  separator,
std::initializer_list< std::string_view >  strList 
)

◆ stringReplaceAll()

std::string & Cogs::stringReplaceAll ( std::string &  str,
std::string_view  from,
std::string_view  to 
)
inline

◆ stringStartsWith()

bool Cogs::stringStartsWith ( std::string_view  str,
std::string_view  beginning 
)
inline

◆ stringToLower()

std::string Cogs::stringToLower ( std::string_view  input)
inline

◆ stringToUpper()

std::string Cogs::stringToUpper ( std::string_view  input)
inline

Variable Documentation

◆ logger

constexpr Cogs::Logging::Log Cogs::logger = Cogs::Logging::getLogger("FileSystemWatcher")
constexpr