Lodestone.Common
Loading...
Searching...
No Matches
lodestone::common::util::Util Class Reference

#include <Util.h>

Public Member Functions

 Util ()=delete

Static Public Member Functions

static constexpr bool strcmpConstexpr (const char *lhs, const char *rhs)
static constexpr size_t strlenConstexpr (const char *s)
template<size_t Len>
static consteval size_t strlenCompileTime (const char(&)[Len])
static unsigned long long getCurrentTimeMillis ()

Constructor & Destructor Documentation

◆ Util()

lodestone::common::util::Util::Util ( )
delete

Member Function Documentation

◆ getCurrentTimeMillis()

unsigned long long lodestone::common::util::Util::getCurrentTimeMillis ( )
static
8 {
9 return std::chrono::duration_cast<std::chrono::milliseconds>(
10 std::chrono::system_clock::now().time_since_epoch())
11 .count();
12}

◆ strcmpConstexpr()

constexpr bool lodestone::common::util::Util::strcmpConstexpr ( const char * lhs,
const char * rhs )
inlinestaticconstexpr
15 {
16 while (*lhs || *rhs) {
17 if (*lhs++ != *rhs++)
18 return false;
19 }
20
21 return true;
22 }

◆ strlenCompileTime()

template<size_t Len>
consteval size_t lodestone::common::util::Util::strlenCompileTime ( const char(&)[Len])
inlinestaticconsteval
34 {
35 return Len-1;
36 }

◆ strlenConstexpr()

constexpr size_t lodestone::common::util::Util::strlenConstexpr ( const char * s)
inlinestaticconstexpr
24 {
25 size_t l = 0;
26 while (*s++) {
27 ++l;
28 }
29
30 return l;
31 }

The documentation for this class was generated from the following files: