top | up | prev | next

util Namespace

Classes

class BinaryReader
class BinaryWriter
class CodeFormatter Writes indented text to a stream.
class Date
class DateTime
class FileLockTable
class FilePtr
class Handle
class InvalidPathException
class JsonArray
class JsonBool
class JsonNull
class JsonNumber
class JsonObject
class JsonString
class JsonValue
class LockGuard
class LogFileWriter
class MT
class MappedInputFile
class MappedInputFileImpl
class MemoryReader
class MemoryWriter
class Mutex
class MutexOwner
class OwnerGuard
class Path
class Process
class ProcessFailure
class ProcessImpl
class Sha1
class StringPtr
struct StringPtrHash
class Timestamp
class TimestampProvider
class Trace
struct TraceEntry
class TraceTable
class Tracer

Functions

void AddTraceEntry(EntryKind kind, int32_t id)
uint64_t Align(uint64_t n, uint64_t alignment) inline
void AnsiDone()
void AnsiInit()
void BeginTracing()
std::u32string CharHexEscape(char32_t c)
std::string CharStr(char c)
std::u32string CharStr(char32_t c)
std::string CmajorRootDir()
std::string ConfigDir()
std::int64_t CurrentMs()
std::string CurrentThreadIdStr()
bool DirectoryExists(const std::string& directoryPath)
void DisableConsoleWindow()
void Done()
void DoneFileLocking()
void DoneTrace()
std::string DurationStr(const std::chrono::nanoseconds& duration)
void EndLog()
void EndTracing()
bool EndsWith(const std::string& s, const std::string& suffix)
bool EndsWith(const std::u32string& s, const std::u32string& suffix)
std::string FetchLogMessage(bool& endOfLog, int timeoutMs, bool& timeout)
int FetchLogMessage(char16_t* buf, int size)
bool FileExists(const std::string& filePath)
std::string Format(const std::string& s, int width)
std::string Format(const std::string& s, int width, FormatJustify justify)
std::string Format(const std::string& s, int width, FormatWidth fw)
std::string Format(const std::string& s, int width, FormatWidth fw, FormatJustify justify)
std::string Format(const std::string& s, int width, FormatWidth fw, FormatJustify justify, char fillChar)
std::u32string FormatNumber(int n, int numDigits)
std::string FormatTimeMs(int32_t milliseconds)
Date GetCurrentDate()
DateTime GetCurrentDateTime()
int64_t GetCurrentTime()
Timestamp GetCurrentTimestamp()
std::string GetCurrentWorkingDirectory()
std::string GetFullPath(const std::string& path)
int GetMonthDays(Month month, int year)
std::string GetPathToExecutable()
int GetPid()
std::string GetSha1MessageDigest(const std::string& message)
int32_t GetTraceFunctionId(const std::string& functionFullName)
const std::string& GetTraceFunctionName(int32_t traceFunctionId)
const std::string& GetTraceMessageName(int32_t traceMessageId)
std::string HexEscape(char c)
std::u32string HexEscape(uint32_t c)
char HexNibble(uint8_t n) inline
int64_t Hours(int64_t nanosecs)
void Init()
void InitFileLocking()
void InitMt(uint32_t seed)
void InitTrace()
void IntsToUuid(uint64_t int1, uint64_t int2, boost::uuids::uuid& id)
bool IsHandleRedirected(int handle)
bool IsPrime64(uint64_t n)
bool LastComponentsEqual(const std::string& s0, const std::string& s1, char componentSeparator)
uint32_t LeftRotate(uint32_t x, uint32_t n) inline
void LockFile(const std::string& filePath, LockKind lockKind)
int Log10(int n)
void LogMessage(int logStreamId, const std::string& message)
void LogMessage(int logStreamId, const std::string& message, int indent)
std::string MakeRelativeDirPath(const std::string& dirPath, const std::string& referenceDirPath)
std::string MakeStringLiteral(const std::string& s)
std::u32string MakeStringLiteral(const std::u32string& s)
int64_t Microseconds(int64_t nanosecs)
int64_t Milliseconds(int64_t nanosecs)
int64_t Minutes(int64_t nanosecs)
std::string NarrowString(const char* str, int length)
void NextPrime(boost::multiprecision::uint128_t& x)
FILE* OpenRead(const char* fileName)
FILE* OpenWrite(const char* fileName)
std::vector<std::string> ParseCommand(const std::string& command)
Date ParseDate(const std::string& dateStr)
Date ParseDate(const std::string& dateStr, int& dateEnd)
DateTime ParseDateTime(const std::string& dateTimeStr)
uint8_t ParseHexByte(const std::string& hexByteStr)
Timestamp ParseTimestamp(const std::string& timestampStr)
bool PathExists(const std::string& path)
std::string PlatformStringToUtf8(const std::string& platformString)
std::string QuotedPath(const std::string& path)
uint32_t Random()
uint64_t Random64()
std::string ReadFile(const std::string& fileName)
int ReadFromPipe(int pipeHandle, void* buffer, unsigned int count)
std::vector<TraceEntry> ReadTrace(const std::string& traceFilePath)
void ReadTraceTable()
void RedirectStdHandlesToPipes(std::vector<int>& oldHandles, std::vector<int>& pipeHandles)
std::string Replace(const std::string& s, char oldChar, char newChar)
std::string Replace(const std::string& s, const std::string& oldString, const std::string& newString)
void RestoreStdHandles(const std::vector<int>& oldHandles)
int64_t Seconds(int64_t nanosecs)
void SetLogMode(LogMode mode)
void SetThreadId(char threadId_)
std::vector<StringT> Split<StringT>(const StringT& s, StringT::value_type c)
std::vector<std::string> Split(const std::string& s, char c)
void StartLog()
bool StartsWith(const std::string& s, const std::string& prefix)
bool StartsWith(const std::u32string& s, const std::u32string& prefix)
uint64_t StringLen(const char32_t* s) inline
std::string StringStr(const std::string& s)
std::u32string StringStr(const std::u32string& s)
void System(const std::string& command)
void System(const std::string& command, bool ignoreReturnValue)
void System(const std::string& command, const std::vector<std::pair<int, std::string>>& redirections)
void System(const std::string& command, int redirectFd, const std::string& toFile)
void System(const std::string& command, int redirectFd, const std::string& toFile, bool ignoreReturnValue)
void ThrowInvalidDate(const std::string& s)
void ThrowInvalidDateTime(const std::string& s)
void ThrowRuntimeError(const std::string& message)
void TimeDone()
void TimeInit()
std::string ToHexString(uint16_t x)
std::string ToHexString(uint32_t x)
std::string ToHexString(uint64_t x)
std::string ToHexString(uint8_t x)
std::string ToLower(const std::string& s)
std::string ToString(double x)
std::string ToString(double x, int maxNumDecimals)
std::string ToString(double x, int minNumDecimals, int maxNumDecimals)
std::string ToUpper(const std::string& s)
std::string TraceDir()
std::string TraceFilePath()
std::string TraceTablePath()
std::string Trim(const std::string& s)
std::u32string Trim(const std::u32string& s)
std::string TrimAll(const std::string& s)
std::u32string TrimAll(const std::u32string& s)
void UnlockFile(const std::string& filePath, LockKind lockKind)
void UuidToInts(const boost::uuids::uuid& id, uint64_t& int1, uint64_t& int2)
int WaitForLogMessage()
std::string WinMsgFilePath()
int WriteToPipe(int pipeHandle, void* buffer, unsigned int count)
void WriteTraceTable()
void WriteUtf8(std::ostream& s, const std::string& str)
int get_default_pmode()
bool operator!=(StringPtr left, StringPtr right) inline
bool operator!=(const Date& left, const Date& right) inline
bool operator!=(const DateTime& left, const DateTime& right) inline
bool operator!=(const Timestamp& left, const Timestamp& right) inline
Redirections operator&(Redirections left, Redirections right) constexpr
bool operator<(StringPtr left, StringPtr right) inline
bool operator<(const Date& left, const Date& right)
bool operator<(const DateTime& left, const DateTime& right)
bool operator<(const Timestamp& left, const Timestamp& right)
CodeFormatter& operator<<(CodeFormatter& f, bool b)
CodeFormatter& operator<<(CodeFormatter& f, char c)
CodeFormatter& operator<<(CodeFormatter& f, const char* s)
CodeFormatter& operator<<(CodeFormatter& f, const std::string& s)
CodeFormatter& operator<<(CodeFormatter& f, double x)
CodeFormatter& operator<<(CodeFormatter& f, int x)
CodeFormatter& operator<<(CodeFormatter& f, int64_t x)
CodeFormatter& operator<<(CodeFormatter& f, uint64_t x)
LogFileWriter& operator<<(LogFileWriter& writer, bool b)
LogFileWriter& operator<<(LogFileWriter& writer, char c)
LogFileWriter& operator<<(LogFileWriter& writer, const char* s)
LogFileWriter& operator<<(LogFileWriter& writer, const std::string& s)
LogFileWriter& operator<<(LogFileWriter& writer, double x)
LogFileWriter& operator<<(LogFileWriter& writer, int x)
LogFileWriter& operator<<(LogFileWriter& writer, int64_t x)
LogFileWriter& operator<<(LogFileWriter& writer, uint64_t x)
bool operator<=(const Date& left, const Date& right) inline
bool operator<=(const DateTime& left, const DateTime& right) inline
bool operator<=(const Timestamp& left, const Timestamp& right) inline
bool operator==(StringPtr left, StringPtr right) inline
bool operator==(const Date& left, const Date& right)
bool operator==(const DateTime& left, const DateTime& right)
bool operator==(const Timestamp& left, const Timestamp& right)
bool operator>(const Date& left, const Date& right) inline
bool operator>(const DateTime& left, const DateTime& right) inline
bool operator>(const Timestamp& left, const Timestamp& right) inline
bool operator>=(const Date& left, const Date& right) inline
bool operator>=(const DateTime& left, const DateTime& right) inline
bool operator>=(const Timestamp& left, const Timestamp& right) inline
Redirections operator|(Redirections left, Redirections right) constexpr

Enumerations

enum class EntryKind
enum class FormatJustify
enum class FormatWidth
enum class JsonValueType
enum class LockKind
enum class LogMode
enum class Month

Variables

const std::string bgBlack
const std::string bgBlue
const std::string bgCyan
const std::string bgDarkBlue
const std::string bgDarkCyan
const std::string bgDarkGreen
const std::string bgDarkMagenta
const std::string bgDarkRed
const std::string bgDarkYellow
const std::string bgGray
const std::string bgGreen
const std::string bgMagenta
const std::string bgRed
const std::string bgWhite
const std::string bgYellow
bool debugFileLocking
bool disableConsoleWindow
bool endLog
const std::string fgBlack
const std::string fgBlue
const std::string fgCyan
const std::string fgDarkBlue
const std::string fgDarkCyan
const std::string fgDarkGreen
const std::string fgDarkMagenta
const std::string fgDarkRed
const std::string fgDarkYellow
const std::string fgGray
const std::string fgGreen
const std::string fgMagenta
const std::string fgRed
const std::string fgWhite
const std::string fgYellow
std::list<std::string> log
std::string logMessage
LogMode logMode
std::mutex logMutex
std::condition_variable messageEnqueuedOrEndLog
MT* mt
const std::string reset
const int secsInDay
std::chrono::time_point<std::chrono::steady_clock> start
char threadId
bool tracing

Function Details

AddTraceEntry Function

void soulng::util::AddTraceEntry(EntryKind kind, int32_t id)

Definition at line 308 of Trace.cpp :
309 {
310     if (!tracing) return;
311     std::chrono::steady_clock::duration time = std::chrono::steady_clock::now() - start;
312     TraceEntry entry(kindthreadIdidstd::chrono::duration_cast<std::chrono::nanoseconds>(time).count());
313     Trace::Instance().AddEntry(entry);
314 }


Declaration at line 35 of Trace.hpp

Calls: soulng::util::Trace::AddEntry , soulng::util::Trace::Instance

Called by: soulng::util::Tracer::destructor


Align Function

uint64_t soulng::util::Align(uint64_t n, uint64_t alignment) inline

Definition at line 35 of Util.hpp :
36 {
37     return (n + alignment - 1u) & -alignment;
38 }



AnsiDone Function

void soulng::util::AnsiDone()

Definition at line 954 of Ansi.cpp :
955 {
959 }


Declaration at line 54 of Ansi.hpp


AnsiInit Function

void soulng::util::AnsiInit()

Definition at line 947 of Ansi.cpp :
948 {
952 }


Declaration at line 53 of Ansi.hpp


BeginTracing Function

void soulng::util::BeginTracing()

Definition at line 284 of Trace.cpp :
285 {
286     tracing = true;
287     start = std::chrono::steady_clock::now();
288 }


Declaration at line 29 of Trace.hpp


CharHexEscape Function

std::u32string soulng::util::CharHexEscape(char32_t c)

Definition at line 203 of TextUtils.cpp :
204 {
205     std::stringstream s;
206     s << "\\U" << ToHexString(static_cast<uint32_t>(c));
207     return ToUtf32(s.str());
208 }



CharStr Function

std::string soulng::util::CharStr(char c)

Definition at line 210 of TextUtils.cpp
Declaration at line 34 of TextUtils.hpp


CharStr Function

std::u32string soulng::util::CharStr(char32_t c)

Definition at line 239 of TextUtils.cpp
Declaration at line 35 of TextUtils.hpp


CmajorRootDir Function

std::string soulng::util::CmajorRootDir()

Definition at line 22 of Trace.cpp :
 23 {
 24     char* e = getenv("CMAJOR_ROOT");
 25     if (e == nullptr || !*e)
 26     {
 27         throw std::runtime_error("please set 'CMAJOR_ROOT' environment variable to contain /path/to/cmajor directory.");
 28     }
 29     return std::string(e);
 30 }



ConfigDir Function

std::string soulng::util::ConfigDir()

Definition at line 40 of Trace.cpp :
 41 {
 42     std::string root = CmajorRootDir();
 43     std::string configDir = GetFullPath(Path::Combine(root"config"));
 44     boost::filesystem::create_directories(configDir);
 45     return configDir;
 46 }


Calls: soulng::util::Path::Combine


CurrentMs Function

std::int64_t soulng::util::CurrentMs()

Definition at line 459 of Time.cpp :
460 {
461     return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - std::chrono::steady_clock::time_point()).count();
462 }


Declaration at line 193 of Time.hpp


CurrentThreadIdStr Function

std::string soulng::util::CurrentThreadIdStr()

Definition at line 538 of TextUtils.cpp :
539 {
540     std::stringstream s;
541     s << std::this_thread::get_id();
542     return s.str();
543 }


Declaration at line 59 of TextUtils.hpp


DirectoryExists Function

bool soulng::util::DirectoryExists(const std::string& directoryPath)

Definition at line 72 of Path.cpp
Declaration at line 21 of Path.hpp


DisableConsoleWindow Function

void soulng::util::DisableConsoleWindow()

Definition at line 30 of System.cpp :
 31 {
 32     disableConsoleWindow = true;
 33 }


Declaration at line 25 of System.hpp


Done Function

void soulng::util::Done()

Definition at line 26 of InitDone.cpp :
27 {
28     soulng::util::TimeDone();
29     soulng::util::DoneTrace();
30     soulng::util::AnsiDone();
31     soulng::util::DoneSocket();
32     soulng::util::DoneFileLocking();
33     soulng::unicode::UnicodeDone();
34 }


Declaration at line 13 of InitDone.hpp


DoneFileLocking Function

void soulng::util::DoneFileLocking()

Definition at line 178 of FileLocking.cpp :
179 {
180     FileLockTable::Done();
181 }


Declaration at line 21 of FileLocking.hpp

Calls: soulng::util::FileLockTable::Done


DoneTrace Function

void soulng::util::DoneTrace()

Definition at line 322 of Trace.cpp :
323 {
324     TraceTable::Done();
325     Trace::Done();
326 }


Declaration at line 40 of Trace.hpp

Calls: soulng::util::Trace::Done , soulng::util::TraceTable::Done


DurationStr Function

std::string soulng::util::DurationStr(const std::chrono::nanoseconds& duration)

Definition at line 496 of Time.cpp
Declaration at line 197 of Time.hpp


EndLog Function

void soulng::util::EndLog()

Definition at line 37 of Log.cpp
Declaration at line 20 of Log.hpp


EndTracing Function

void soulng::util::EndTracing()

Definition at line 290 of Trace.cpp :
291 {
292     tracing = false;
293     Trace::Instance().Write();
294 }


Declaration at line 30 of Trace.hpp

Calls: soulng::util::Trace::Instance , soulng::util::Trace::Write


EndsWith Function

bool soulng::util::EndsWith(const std::string& s, const std::string& suffix)

Definition at line 341 of TextUtils.cpp :
342 {
343     int n = int(suffix.length());
344     int m = int(s.length());
345     return m >= n && s.substr(m - nn) == suffix;
346 }


Declaration at line 44 of TextUtils.hpp


EndsWith Function

bool soulng::util::EndsWith(const std::u32string& s, const std::u32string& suffix)

Definition at line 348 of TextUtils.cpp :
349 {
350     int n = int(suffix.length());
351     int m = int(s.length());
352     return m >= n && s.substr(m - nn) == suffix;
353 }


Declaration at line 45 of TextUtils.hpp


FetchLogMessage Function

std::string soulng::util::FetchLogMessage(bool & endOfLog, int timeoutMs, bool & timeout)

Definition at line 126 of Log.cpp
Declaration at line 25 of Log.hpp


FetchLogMessage Function

int soulng::util::FetchLogMessage(char16_t * buf, int size)

Definition at line 106 of Log.cpp
Declaration at line 24 of Log.hpp


FileExists Function

bool soulng::util::FileExists(const std::string& filePath)

Definition at line 43 of Path.cpp
Declaration at line 20 of Path.hpp


Format Function

std::string soulng::util::Format(const std::string& s, int width)

Definition at line 545 of TextUtils.cpp :
546 {
547     return Format(swidthFormatWidth::exactFormatJustify::left);
548 }


Declaration at line 60 of TextUtils.hpp


Format Function

std::string soulng::util::Format(const std::string& s, int width, FormatJustify justify)

Definition at line 550 of TextUtils.cpp :
551 {
552     return Format(swidthFormatWidth::exactjustify);
553 }


Declaration at line 61 of TextUtils.hpp


Format Function

std::string soulng::util::Format(const std::string& s, int width, FormatWidth fw)

Definition at line 555 of TextUtils.cpp :
556 {
557     return Format(swidthfwFormatJustify::left);
558 }


Declaration at line 62 of TextUtils.hpp


Format Function

std::string soulng::util::Format(const std::string& s, int width, FormatWidth fw, FormatJustify justify)

Definition at line 560 of TextUtils.cpp :
561 {
562     return Format(swidthfwjustify' ');
563 }


Declaration at line 63 of TextUtils.hpp


Format Function

std::string soulng::util::Format(const std::string& s, int width, FormatWidth fw, FormatJustify justify, char fillChar)

Definition at line 565 of TextUtils.cpp
Declaration at line 64 of TextUtils.hpp

Called by: soulng::util::Timestamp::ToString


FormatNumber Function

std::u32string soulng::util::FormatNumber(int n, int numDigits)

Definition at line 520 of TextUtils.cpp
Declaration at line 58 of TextUtils.hpp


FormatTimeMs Function

std::string soulng::util::FormatTimeMs(int32_t milliseconds)

Definition at line 277 of Time.cpp
Declaration at line 191 of Time.hpp


GetCurrentDate Function

Date soulng::util::GetCurrentDate()

Definition at line 158 of Time.cpp :
159 {
160     std::time_t currentTime;
161     std::time(&currentTime);
162     struct tm* localTime = nullptr;
163     localTime = std::localtime(&currentTime);
164     return Date(1900 + localTime->tm_yearstatic_cast<Month>(1 + localTime->tm_mon)static_cast<int8_t>(localTime->tm_mday));
165 }


Declaration at line 54 of Time.hpp

Called by: soulng::util::TimestampProvider::GetCurrentTimestamp


GetCurrentDateTime Function

DateTime soulng::util::GetCurrentDateTime()

Definition at line 299 of Time.cpp :
300 {
301     std::time_t currentTime;
302     std::time(&currentTime);
303     struct tm* localTime = nullptr;
304     localTime = std::localtime(&currentTime);
305     return DateTime(Date(1900 + localTime->tm_yearstatic_cast<Month>(1 + localTime->tm_mon)static_cast<int8_t>(localTime->tm_mday))localTime->tm_hour * 3600 + localTime->tm_min * 60 + localTime->tm_sec);
306 }


Declaration at line 117 of Time.hpp

Called by: soulng::util::LogFileWriter::WriteCurrentDateTime , soulng::util::TimestampProvider::Reset


GetCurrentTime Function

int64_t soulng::util::GetCurrentTime()

Definition at line 464 of Time.cpp :
465 {
466     std::time_t currentTime;
467     std::time(&currentTime);
468     return currentTime;
469 }


Declaration at line 195 of Time.hpp


GetCurrentTimestamp Function

Timestamp soulng::util::GetCurrentTimestamp()

Definition at line 447 of Time.cpp :
448 {
449     return TimestampProvider::Instance().GetCurrentTimestamp();
450 }


Declaration at line 187 of Time.hpp

Calls: soulng::util::TimestampProvider::GetCurrentTimestamp , soulng::util::TimestampProvider::Instance


GetCurrentWorkingDirectory Function

std::string soulng::util::GetCurrentWorkingDirectory()

Definition at line 23 of Path.cpp
Declaration at line 19 of Path.hpp

Calls: soulng::util::Path::MakeCanonical


GetFullPath Function

std::string soulng::util::GetFullPath(const std::string& path)

Definition at line 400 of Path.cpp
Declaration at line 23 of Path.hpp

Calls: soulng::util::Path::IsRelative , soulng::util::Path::MakeCanonical


GetMonthDays Function

int soulng::util::GetMonthDays(Month month, int year)

Definition at line 15 of Time.cpp :
 16 {
 17     static int monthDays[] = { 0312831303130313130313031 };
 18     if (month == Month::february&&(  (year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
 19     {
 20         return 29;
 21     }
 22     return monthDays[static_cast<int>(month)];
 23 }


Declaration at line 20 of Time.hpp

Called by: soulng::util::Date::AddDays , soulng::util::Date::AddMonths , soulng::util::Date::AddYears


GetPathToExecutable Function

std::string soulng::util::GetPathToExecutable()

Definition at line 453 of System.cpp
Declaration at line 37 of System.hpp


GetPid Function

int soulng::util::GetPid()

Definition at line 66 of Process.cpp :
67 {
71     return getpid();
73 }


Declaration at line 53 of Process.hpp


GetSha1MessageDigest Function

std::string soulng::util::GetSha1MessageDigest(const std::string& message)

Definition at line 137 of Sha1.cpp :
138 {
139     Sha1 sha1;
140     sha1.Process((void*)message.c_str()int(message.length()));
141     return sha1.GetDigest();
142 }


Declaration at line 48 of Sha1.hpp

Calls: soulng::util::Sha1::GetDigest


GetTraceFunctionId Function

int32_t soulng::util::GetTraceFunctionId(const std::string& functionFullName)

Definition at line 197 of Trace.cpp :
198 {
199     return TraceTable::Instance().GetTraceFunctionId(functionFullName);
200 }


Declaration at line 32 of Trace.hpp

Calls: soulng::util::TraceTable::GetTraceFunctionId , soulng::util::TraceTable::Instance


GetTraceFunctionName Function

const std::string& soulng::util::GetTraceFunctionName(int32_t traceFunctionId)

Definition at line 202 of Trace.cpp :
203 {
204     return TraceTable::Instance().GetTraceFunctionName(traceFunctionId);
205 }


Declaration at line 33 of Trace.hpp

Calls: soulng::util::TraceTable::GetTraceFunctionName , soulng::util::TraceTable::Instance


GetTraceMessageName Function

const std::string& soulng::util::GetTraceMessageName(int32_t traceMessageId)

Definition at line 207 of Trace.cpp :
208 {
209     return TraceTable::Instance().GetTraceMessageName(traceMessageId);
210 }


Declaration at line 34 of Trace.hpp

Calls: soulng::util::TraceTable::GetTraceMessageName , soulng::util::TraceTable::Instance


HexEscape Function

std::string soulng::util::HexEscape(char c)

Definition at line 189 of TextUtils.cpp :
190 {
191     std::stringstream s;
192     s << "\\x" << std::hex << int(static_cast<unsigned char>(c));
193     return s.str();
194 }


Declaration at line 32 of TextUtils.hpp


HexEscape Function

std::u32string soulng::util::HexEscape(uint32_t c)

Definition at line 196 of TextUtils.cpp :
197 {
198     std::stringstream s;
199     s << "\\x" << std::hex << c;
200     return ToUtf32(s.str());
201 }


Declaration at line 33 of TextUtils.hpp


HexNibble Function

char soulng::util::HexNibble(uint8_t n) inline

Definition at line 445 of TextUtils.cpp :
446 {
447     static const char* h = "0123456789ABCDEF";
448     return h[n];
449 }



Hours Function

int64_t soulng::util::Hours(int64_t nanosecs)

Definition at line 471 of Time.cpp :
472 {
473     return nanosecs / (3600ll * int64_t(1000000000ll));
474 }



Init Function

void soulng::util::Init()

Definition at line 16 of InitDone.cpp :
17 {
18     soulng::unicode::UnicodeInit();
19     soulng::util::InitFileLocking();
20     soulng::util::InitSocket();
21     soulng::util::AnsiInit();
22     soulng::util::InitTrace();
23     soulng::util::TimeInit();
24 }


Declaration at line 12 of InitDone.hpp


InitFileLocking Function

void soulng::util::InitFileLocking()

Definition at line 173 of FileLocking.cpp :
174 {
175     FileLockTable::Init();
176 }


Declaration at line 20 of FileLocking.hpp

Calls: soulng::util::FileLockTable::Init


InitMt Function

void soulng::util::InitMt(uint32_t seed)

Definition at line 132 of Random.cpp :
133 {
134     if (mt == nullptr)
135     {
136         mt = new MT();
137     }
138     mt->Init(seed);
139 }


Declaration at line 13 of Random.hpp

Calls: soulng::util::MT::Init


InitTrace Function

void soulng::util::InitTrace()

Definition at line 316 of Trace.cpp :
317 {
318     Trace::Init();
319     TraceTable::Init();
320 }


Declaration at line 39 of Trace.hpp

Calls: soulng::util::Trace::Init , soulng::util::TraceTable::Init


IntsToUuid Function

void soulng::util::IntsToUuid(uint64_t int1, uint64_t int2, boost::uuids::uuid& id)

Definition at line 21 of Uuid.cpp :
22 {
26     uint8_t* i = id.begin();
27     uint64_t* i64 = reinterpret_cast<uint64_t*>(i);
28     *i64++ = int1;
29     *i64 = int2;
30 }


Declaration at line 15 of Uuid.hpp


IsHandleRedirected Function

bool soulng::util::IsHandleRedirected(int handle)

Definition at line 97 of CodeFormatter.cpp :
 98 {
 99     return !isatty(handle);
100 }


Declaration at line 74 of CodeFormatter.hpp


IsPrime64 Function

bool soulng::util::IsPrime64(uint64_t n)

Definition at line 11 of Prime.cpp


LastComponentsEqual Function

bool soulng::util::LastComponentsEqual(const std::string& s0, const std::string& s1, char componentSeparator)

Definition at line 315 of TextUtils.cpp
Declaration at line 41 of TextUtils.hpp


LeftRotate Function

uint32_t soulng::util::LeftRotate(uint32_t x, uint32_t n) inline

Definition at line 11 of Sha1.cpp :
 12 {
 13     return (x << n) ^ (x >> (32 - n));
 14 }


Called by: soulng::util::Sha1::ProcessBlock


LockFile Function

void soulng::util::LockFile(const std::string& filePath, LockKind lockKind)

Definition at line 163 of FileLocking.cpp :
164 {
165     FileLockTable::Instance().LockFile(GetFullPath(filePath)lockKind);
166 }


Declaration at line 18 of FileLocking.hpp

Calls: soulng::util::FileLockTable::Instance , soulng::util::FileLockTable::LockFile


Log10 Function

int soulng::util::Log10(int n)

Definition at line 508 of TextUtils.cpp :
509 {
510     int log10 = 1;
511     int m = n / 10;
512     while (m > 0)
513     {
514         ++log10;
515         m = m / 10;
516     }
517     return log10;
518 }


Declaration at line 57 of TextUtils.hpp


LogMessage Function

void soulng::util::LogMessage(int logStreamId, const std::string& message)

Definition at line 55 of Log.cpp
Declaration at line 21 of Log.hpp

Called by: soulng::util::FileLockTable::LockFile


LogMessage Function

void soulng::util::LogMessage(int logStreamId, const std::string& message, int indent)

Definition at line 83 of Log.cpp :
 84 {
 85     LogMessage(logStreamIdstd::string(indent' ') + message);
 86 }


Declaration at line 22 of Log.hpp


MakeRelativeDirPath Function

std::string soulng::util::MakeRelativeDirPath(const std::string& dirPath, const std::string& referenceDirPath)

Definition at line 459 of Path.cpp
Declaration at line 24 of Path.hpp

Calls: soulng::util::Path::Combine , soulng::util::Path::GetDrive


MakeStringLiteral Function

std::string soulng::util::MakeStringLiteral(const std::string& s)

Definition at line 290 of TextUtils.cpp :
291 {
292     std::string result = "\"";
293     result.append(StringStr(s));
294     result.append(1'"');
295     return result;
296 }


Declaration at line 38 of TextUtils.hpp


MakeStringLiteral Function

std::u32string soulng::util::MakeStringLiteral(const std::u32string& s)

Definition at line 298 of TextUtils.cpp :
299 {
300     std::u32string result = U"\"";
301     result.append(StringStr(s));
302     result.append(1'"');
303     return result;
304 }


Declaration at line 39 of TextUtils.hpp


Microseconds Function

int64_t soulng::util::Microseconds(int64_t nanosecs)

Definition at line 491 of Time.cpp :
492 {
493     return nanosecs / int64_t(1000ll);
494 }



Milliseconds Function

int64_t soulng::util::Milliseconds(int64_t nanosecs)

Definition at line 486 of Time.cpp :
487 {
488     return nanosecs / int64_t(1000000ll);
489 }



Minutes Function

int64_t soulng::util::Minutes(int64_t nanosecs)

Definition at line 476 of Time.cpp :
477 {
478     return nanosecs / (60ll * int64_t(1000000000ll));
479 }



NarrowString Function

std::string soulng::util::NarrowString(const char * str, int length)

Definition at line 355 of TextUtils.cpp
Declaration at line 46 of TextUtils.hpp


NextPrime Function

void soulng::util::NextPrime(boost::multiprecision::uint128_t& x)

Definition at line 26 of Prime.cpp
Declaration at line 15 of Prime.hpp


OpenRead Function

FILE* soulng::util::OpenRead(const char * fileName)

Definition at line 15 of FilePtr.cpp
Declaration at line 36 of FilePtr.hpp


OpenWrite Function

FILE* soulng::util::OpenWrite(const char * fileName)

Definition at line 30 of FilePtr.cpp
Declaration at line 37 of FilePtr.hpp


ParseCommand Function

std::vector<std::string> soulng::util::ParseCommand(const std::string& command)

Definition at line 72 of System.cpp


ParseDate Function

Date soulng::util::ParseDate(const std::string& dateStr)

Definition at line 235 of Time.cpp :
236 {
237     int dateEnd = 0;
238     return ParseDate(dateStrdateEnd);
239 }


Declaration at line 80 of Time.hpp


ParseDate Function

Date soulng::util::ParseDate(const std::string& dateStr, int & dateEnd)

Definition at line 196 of Time.cpp


ParseDateTime Function

DateTime soulng::util::ParseDateTime(const std::string& dateTimeStr)

Definition at line 320 of Time.cpp
Declaration at line 143 of Time.hpp


ParseHexByte Function

uint8_t soulng::util::ParseHexByte(const std::string& hexByteStr)

Definition at line 490 of TextUtils.cpp
Declaration at line 56 of TextUtils.hpp


ParseTimestamp Function

Timestamp soulng::util::ParseTimestamp(const std::string& timestampStr)

Definition at line 452 of Time.cpp :
453 {
454     DateTime dateTime = ParseDateTime(timestampStr.substr(019));
455     int32_t nanosecs = boost::lexical_cast<int>(timestampStr.substr(20));
456     return Timestamp(dateTimenanosecs);
457 }


Declaration at line 189 of Time.hpp


PathExists Function

bool soulng::util::PathExists(const std::string& path)

Definition at line 101 of Path.cpp
Declaration at line 22 of Path.hpp


PlatformStringToUtf8 Function

std::string soulng::util::PlatformStringToUtf8(const std::string& platformString)

Definition at line 616 of TextUtils.cpp :
617 {
618     return platformString;
619 }


Declaration at line 65 of TextUtils.hpp

Called by: soulng::util::BinaryWriter::FlushBuffer , soulng::util::BinaryWriter::Seek


QuotedPath Function

std::string soulng::util::QuotedPath(const std::string& path)

Definition at line 306 of TextUtils.cpp :
307 {
308     if (path.find(' ') != std::string::npos)
309     {
310         return std::string("\"") + path + "\"";
311     }
312     return path;
313 }


Declaration at line 40 of TextUtils.hpp


Random Function

uint32_t soulng::util::Random()

Definition at line 141 of Random.cpp
Declaration at line 15 of Random.hpp

Calls: soulng::util::MT::GenRand , soulng::util::MT::InitWithRandomSeed , soulng::util::MT::Initialized


Random64 Function

uint64_t soulng::util::Random64()

Definition at line 154 of Random.cpp :
155 {
156     return static_cast<uint64_t>(Random()) << 32 | static_cast<uint64_t>(Random());
157 }


Declaration at line 16 of Random.hpp


ReadFile Function

std::string soulng::util::ReadFile(const std::string& fileName)

Definition at line 71 of MappedInputFile.cpp
Declaration at line 28 of MappedInputFile.hpp

Calls: soulng::util::MappedInputFile::Begin , soulng::util::MappedInputFile::End


ReadFromPipe Function

int soulng::util::ReadFromPipe(int pipeHandle, void * buffer, unsigned int count)

Definition at line 368 of System.cpp :
369 {
370     return read(pipeHandlebuffercount);
371 }


Declaration at line 33 of System.hpp


ReadTrace Function

std::vector<TraceEntry > soulng::util::ReadTrace(const std::string& traceFilePath)

Definition at line 263 of Trace.cpp
Declaration at line 36 of Trace.hpp

Calls: soulng::util::BinaryReader::ReadChar , soulng::util::BinaryReader::ReadInt , soulng::util::BinaryReader::ReadLong , soulng::util::BinaryReader::ReadSByte


ReadTraceTable Function

void soulng::util::ReadTraceTable()

Definition at line 187 of Trace.cpp :
188 {
189     TraceTable::Instance().Read();
190 }


Declaration at line 37 of Trace.hpp

Calls: soulng::util::TraceTable::Instance , soulng::util::TraceTable::Read


RedirectStdHandlesToPipes Function

void soulng::util::RedirectStdHandlesToPipes(std::vector<int >& oldHandles, std::vector<int >& pipeHandles)

Definition at line 378 of System.cpp
Declaration at line 35 of System.hpp


Replace Function

std::string soulng::util::Replace(const std::string& s, char oldChar, char newChar)

Definition at line 159 of TextUtils.cpp
Declaration at line 30 of TextUtils.hpp


Replace Function

std::string soulng::util::Replace(const std::string& s, const std::string& oldString, const std::string& newString)

Definition at line 173 of TextUtils.cpp
Declaration at line 31 of TextUtils.hpp


RestoreStdHandles Function

void soulng::util::RestoreStdHandles(const std::vector<int >& oldHandles)

Definition at line 433 of System.cpp
Declaration at line 36 of System.hpp


Seconds Function

int64_t soulng::util::Seconds(int64_t nanosecs)

Definition at line 481 of Time.cpp :
482 {
483     return nanosecs / int64_t(1000000000ll);
484 }



SetLogMode Function

void soulng::util::SetLogMode(LogMode mode)

Definition at line 27 of Log.cpp :
 28 {
 29     logMode = mode;
 30 }


Declaration at line 18 of Log.hpp


SetThreadId Function

void soulng::util::SetThreadId(char threadId_)

Definition at line 303 of Trace.cpp :
304 {
305     threadId = threadId_;
306 }


Declaration at line 31 of Trace.hpp


Split Function

std::vector<StringT> soulng::util::Split<StringT>(const StringT& s, StringT::value_type c)

Definition at line 15 of Util.hpp


Split Function

std::vector<std::string> soulng::util::Split(const std::string& s, char c)

Definition at line 139 of TextUtils.cpp
Declaration at line 29 of TextUtils.hpp


StartLog Function

void soulng::util::StartLog()

Definition at line 32 of Log.cpp :
 33 {
 34     endLog = false;
 35 }


Declaration at line 19 of Log.hpp


StartsWith Function

bool soulng::util::StartsWith(const std::string& s, const std::string& prefix)

Definition at line 329 of TextUtils.cpp :
330 {
331     int n = int(prefix.length());
332     return int(s.length()) >= n && s.substr(0n) == prefix;
333 }


Declaration at line 42 of TextUtils.hpp


StartsWith Function

bool soulng::util::StartsWith(const std::u32string& s, const std::u32string& prefix)

Definition at line 335 of TextUtils.cpp :
336 {
337     int n = int(prefix.length());
338     return int(s.length()) >= n && s.substr(0n) == prefix;
339 }


Declaration at line 43 of TextUtils.hpp


StringLen Function

uint64_t soulng::util::StringLen(const char32_t * s) inline

Definition at line 13 of String.hpp :
14 {
15     uint64_t n = 0;
16     Assert(s"null string ptr");
17     while (*s++) ++n;
18     return n;
19 }



StringStr Function

std::string soulng::util::StringStr(const std::string& s)

Definition at line 268 of TextUtils.cpp :
269 {
270     std::string r;
271     int n = int(s.length());
272     for (int i = 0; i < n; ++i)
273     {
274         r.append(CharStr(s[i]));
275     }
276     return r;
277 }


Declaration at line 36 of TextUtils.hpp


StringStr Function

std::u32string soulng::util::StringStr(const std::u32string& s)

Definition at line 279 of TextUtils.cpp :
280 {
281     std::u32string r;
282     int n = int(s.length());
283     for (int i = 0; i < n; ++i)
284     {
285         r.append(CharStr(s[i]));
286     }
287     return r;
288 }


Declaration at line 37 of TextUtils.hpp


System Function

void soulng::util::System(const std::string& command)

Definition at line 208 of System.cpp :
209 {
210     return System(commandfalse);
211 }


Declaration at line 26 of System.hpp


System Function

void soulng::util::System(const std::string& command, bool ignoreReturnValue)

Definition at line 131 of System.cpp
Declaration at line 27 of System.hpp


System Function

void soulng::util::System(const std::string& command, const std::vector<std::pair<int , std::string>>& redirections)

Definition at line 246 of System.cpp
Declaration at line 30 of System.hpp


System Function

void soulng::util::System(const std::string& command, int redirectFd, const std::string& toFile)

Definition at line 241 of System.cpp :
242 {
243     System(commandredirectFdtoFilefalse);
244 }


Declaration at line 28 of System.hpp


System Function

void soulng::util::System(const std::string& command, int redirectFd, const std::string& toFile, bool ignoreReturnValue)

Definition at line 213 of System.cpp
Declaration at line 29 of System.hpp


ThrowInvalidDate Function

void soulng::util::ThrowInvalidDate(const std::string& s)

Definition at line 186 of Time.cpp :
187 {
188     ThrowRuntimeError("cannot parse date from string '" + s + "': not in format YYYY-MM-DD or YYYYMMDD");
189 }



ThrowInvalidDateTime Function

void soulng::util::ThrowInvalidDateTime(const std::string& s)

Definition at line 191 of Time.cpp :
192 {
193     ThrowRuntimeError("cannot parse date time from string '" + s + "': not in format YYYY[-]MM[-]DD or YYYY[-]MM[-]DDTHH[[:]MM[[:]SS]");
194 }



ThrowRuntimeError Function

void soulng::util::ThrowRuntimeError(const std::string& message)

Definition at line 181 of Time.cpp :
182 {
183     throw std::runtime_error(message);
184 }



TimeDone Function

void soulng::util::TimeDone()

Definition at line 528 of Time.cpp :
529 {
530     TimestampProvider::Done();
531 }


Declaration at line 200 of Time.hpp

Calls: soulng::util::TimestampProvider::Done


TimeInit Function

void soulng::util::TimeInit()

Definition at line 523 of Time.cpp :
524 {
525     TimestampProvider::Init();
526 }


Declaration at line 199 of Time.hpp

Calls: soulng::util::TimestampProvider::Init


ToHexString Function

std::string soulng::util::ToHexString(uint16_t x)

Definition at line 458 of TextUtils.cpp :
459 {
460     std::string s;
461     s.append(ToHexString(uint8_t((x >> 8) & 0xFF)));
462     s.append(ToHexString(uint8_t((x & 0xFF))));
463     return s;
464 }


Declaration at line 53 of TextUtils.hpp


ToHexString Function

std::string soulng::util::ToHexString(uint32_t x)

Definition at line 466 of TextUtils.cpp :
467 {
468     std::string s;
469     s.append(ToHexString(uint8_t((x >> 24) & 0xFF)));
470     s.append(ToHexString(uint8_t((x >> 16) & 0xFF)));
471     s.append(ToHexString(uint8_t((x >> 8) & 0xFF)));
472     s.append(ToHexString(uint8_t((x & 0xFF))));
473     return s;
474 }


Declaration at line 54 of TextUtils.hpp


ToHexString Function

std::string soulng::util::ToHexString(uint64_t x)

Definition at line 476 of TextUtils.cpp
Declaration at line 55 of TextUtils.hpp


ToHexString Function

std::string soulng::util::ToHexString(uint8_t x)

Definition at line 451 of TextUtils.cpp :
452 {
453     std::string s;
454     s.append(1HexNibble(x >> 4)).append(1HexNibble(x & 0x0F));
455     return s;
456 }


Declaration at line 52 of TextUtils.hpp


ToLower Function

std::string soulng::util::ToLower(const std::string& s)

Definition at line 399 of TextUtils.cpp :
400 {
401     std::string result;
402     int n = int(s.size());
403     result.reserve(n);
404     for (int i = 0; i < n; ++i)
405     {
406         result.append(1std::tolower(s[i]));
407     }
408     return result;
409 }


Declaration at line 48 of TextUtils.hpp


ToString Function

std::string soulng::util::ToString(double x)

Definition at line 411 of TextUtils.cpp :
412 {
413     return ToString(x15);
414 }


Declaration at line 49 of TextUtils.hpp


ToString Function

std::string soulng::util::ToString(double x, int maxNumDecimals)

Definition at line 416 of TextUtils.cpp :
417 {
418     return ToString(x0maxNumDecimals);
419 }


Declaration at line 50 of TextUtils.hpp


ToString Function

std::string soulng::util::ToString(double x, int minNumDecimals, int maxNumDecimals)

Definition at line 421 of TextUtils.cpp
Declaration at line 51 of TextUtils.hpp


ToUpper Function

std::string soulng::util::ToUpper(const std::string& s)

Definition at line 387 of TextUtils.cpp :
388 {
389     std::string result;
390     int n = int(s.size());
391     result.reserve(n);
392     for (int i = 0; i < n; ++i)
393     {
394         result.append(1std::toupper(s[i]));
395     }
396     return result;
397 }


Declaration at line 47 of TextUtils.hpp


TraceDir Function

std::string soulng::util::TraceDir()

Definition at line 32 of Trace.cpp :
 33 {
 34     std::string root = CmajorRootDir();
 35     std::string traceDir = GetFullPath(Path::Combine(root"trace"));
 36     boost::filesystem::create_directories(traceDir);
 37     return traceDir;
 38 }


Calls: soulng::util::Path::Combine


TraceFilePath Function

std::string soulng::util::TraceFilePath()

Definition at line 48 of Trace.cpp :
 49 {
 50     std::string traceFilePath = GetFullPath(Path::Combine(TraceDir()"trace.bin"));
 51     return traceFilePath;
 52 }


Calls: soulng::util::Path::Combine

Called by: soulng::util::Trace::Write


TraceTablePath Function

std::string soulng::util::TraceTablePath()

Definition at line 81 of Trace.cpp :
 82 {
 83     return GetFullPath(Path::Combine(TraceDir()"trace.tab"));
 84 }


Calls: soulng::util::Path::Combine

Called by: soulng::util::TraceTable::Read , soulng::util::TraceTable::Write


Trim Function

std::string soulng::util::Trim(const std::string& s)

Definition at line 27 of TextUtils.cpp :
 28 {
 29     int b = 0;
 30     while (b < int(s.length()) && std::isspace(s[b])) ++b;
 31     int e = int(s.length()) - 1;
 32     while (e >= b && std::isspace(s[e])) --e;
 33     return s.substr(be - b + 1);
 34 }


Declaration at line 25 of TextUtils.hpp


Trim Function

std::u32string soulng::util::Trim(const std::u32string& s)

Definition at line 83 of TextUtils.cpp :
 84 {
 85     int b = 0;
 86     while (b < int(s.length()) && IsWhiteSpace(s[b])) ++b;
 87     int e = int(s.length()) - 1;
 88     while (e >= b && IsWhiteSpace(s[e])) --e;
 89     return s.substr(be - b + 1);
 90 }


Declaration at line 27 of TextUtils.hpp


TrimAll Function

std::string soulng::util::TrimAll(const std::string& s)

Definition at line 36 of TextUtils.cpp
Declaration at line 26 of TextUtils.hpp


TrimAll Function

std::u32string soulng::util::TrimAll(const std::u32string& s)

Definition at line 92 of TextUtils.cpp
Declaration at line 28 of TextUtils.hpp


UnlockFile Function

void soulng::util::UnlockFile(const std::string& filePath, LockKind lockKind)

Definition at line 168 of FileLocking.cpp :
169 {
170     FileLockTable::Instance().UnlockFile(GetFullPath(filePath)lockKind);
171 }


Declaration at line 19 of FileLocking.hpp

Calls: soulng::util::FileLockTable::Instance , soulng::util::FileLockTable::UnlockFile

Called by: soulng::util::FilePtr::destructor , soulng::util::MappedInputFile::destructor


UuidToInts Function

void soulng::util::UuidToInts(const boost::uuids::uuid& id, uint64_t& int1, uint64_t& int2)

Definition at line 10 of Uuid.cpp :
11 {
15     const uint8_t* i = id.begin();
16     const uint64_t* i64 = reinterpret_cast<const uint64_t*>(i);
17     int1 = *i64++;
18     int2 = *i64;
19 }


Declaration at line 14 of Uuid.hpp


WaitForLogMessage Function

int soulng::util::WaitForLogMessage()

Definition at line 90 of Log.cpp
Declaration at line 23 of Log.hpp


WinMsgFilePath Function

std::string soulng::util::WinMsgFilePath()

Definition at line 54 of Trace.cpp :
 55 {
 56     std::string winMsgFilePath = GetFullPath(Path::Combine(ConfigDir()"winmsg.txt"));
 57     return winMsgFilePath;
 58 }


Calls: soulng::util::Path::Combine

Called by: soulng::util::TraceTable::Read


WriteToPipe Function

int soulng::util::WriteToPipe(int pipeHandle, void * buffer, unsigned int count)

Definition at line 373 of System.cpp :
374 {
375     return write(pipeHandlebuffercount);
376 }


Declaration at line 34 of System.hpp


WriteTraceTable Function

void soulng::util::WriteTraceTable()

Definition at line 192 of Trace.cpp :
193 {
194     TraceTable::Instance().Write();
195 }


Declaration at line 38 of Trace.hpp

Calls: soulng::util::TraceTable::Instance , soulng::util::TraceTable::Write


WriteUtf8 Function

void soulng::util::WriteUtf8(std::ostream& s, const std::string& str)

Definition at line 102 of CodeFormatter.cpp :
103 {
104     s << str;
105 }


Declaration at line 73 of CodeFormatter.hpp

Called by: soulng::util::CodeFormatter::Write


get_default_pmode Function

int soulng::util::get_default_pmode()

Definition at line 55 of System.cpp


operator!= Function

bool soulng::util::operator!=(StringPtr left, StringPtr right) inline

Definition at line 49 of String.hpp :
50 {
51     return !(left == right);
52 }



operator!= Function

bool soulng::util::operator!=(const Date & left, const Date & right) inline

Definition at line 58 of Time.hpp :
 59 {
 60     return !(left == right);
 61 }



operator!= Function

bool soulng::util::operator!=(const DateTime & left, const DateTime & right) inline

Definition at line 121 of Time.hpp :
122 {
123     return !(left == right);
124 }



operator!= Function

bool soulng::util::operator!=(const Timestamp & left, const Timestamp & right) inline

Definition at line 165 of Time.hpp :
166 {
167     return !(left == right);
168 }



operator& Function

Redirections soulng::util::operator&(Redirections left, Redirections right) constexpr

Definition at line 48 of Process.hpp :
49 {
50     return Process::Redirections(int(left) & int(right));
51 }



operator< Function

bool soulng::util::operator<(StringPtr left, StringPtr right) inline

Definition at line 54 of String.hpp

Calls: soulng::util::StringPtr::Value


operator< Function

bool soulng::util::operator<(const Date & left, const Date & right)

Definition at line 172 of Time.cpp :
173 {
174     if (left.Year() < right.Year()) return true;
175     if (left.Year() > right.Year()) return false;
176     if (left.GetMonth() < right.GetMonth()) return true;
177     if (left.GetMonth() > right.GetMonth()) return false;
178     return left.Day() < right.Day();
179 }


Declaration at line 63 of Time.hpp

Calls: soulng::util::Date::Day , soulng::util::Date::GetMonth , soulng::util::Date::Year


operator< Function

bool soulng::util::operator<(const DateTime & left, const DateTime & right)

Definition at line 313 of Time.cpp :
314 {
315     if (left.GetDate() < right.GetDate()) return true;
316     if (left.GetDate() > right.GetDate()) return false;
317     return left.Seconds() < right.Seconds();
318 }


Declaration at line 126 of Time.hpp

Calls: soulng::util::DateTime::GetDate , soulng::util::DateTime::Seconds


operator< Function

bool soulng::util::operator<(const Timestamp & left, const Timestamp & right)

Definition at line 381 of Time.cpp :
382 {
383     if (left.GetDateTime() < right.GetDateTime()) return true;
384     if (left.GetDateTime() > right.GetDateTime()) return false;
385     return left.Nanoseconds() < right.Nanoseconds();
386 }


Declaration at line 170 of Time.hpp

Calls: soulng::util::Timestamp::GetDateTime , soulng::util::Timestamp::Nanoseconds


operator<< Function

CodeFormatter & soulng::util::operator<<(CodeFormatter & f, bool b)

Definition at line 172 of CodeFormatter.cpp
Declaration at line 67 of CodeFormatter.hpp

Calls: soulng::util::CodeFormatter::Write


operator<< Function

CodeFormatter & soulng::util::operator<<(CodeFormatter & f, char c)

Definition at line 166 of CodeFormatter.cpp :
167 {
168     f.Write(std::string(1c));
169     return f;
170 }


Declaration at line 66 of CodeFormatter.hpp

Calls: soulng::util::CodeFormatter::Write


operator<< Function

CodeFormatter & soulng::util::operator<<(CodeFormatter & f, const char * s)

Definition at line 160 of CodeFormatter.cpp :
161 {
162     f.Write(s);
163     return f;
164 }


Declaration at line 65 of CodeFormatter.hpp

Calls: soulng::util::CodeFormatter::Write


operator<< Function

CodeFormatter & soulng::util::operator<<(CodeFormatter & f, const std::string& s)

Definition at line 154 of CodeFormatter.cpp :
155 {
156     f.Write(s);
157     return f;
158 }


Declaration at line 64 of CodeFormatter.hpp

Calls: soulng::util::CodeFormatter::Write


operator<< Function

CodeFormatter & soulng::util::operator<<(CodeFormatter & f, double x)

Definition at line 191 of CodeFormatter.cpp :
192 {
193     f.Write(std::to_string(x));
194     return f;
195 }


Declaration at line 69 of CodeFormatter.hpp

Calls: soulng::util::CodeFormatter::Write


operator<< Function

CodeFormatter & soulng::util::operator<<(CodeFormatter & f, int x)

Definition at line 185 of CodeFormatter.cpp :
186 {
187     f.Write(std::to_string(x));
188     return f;
189 }


Declaration at line 68 of CodeFormatter.hpp

Calls: soulng::util::CodeFormatter::Write


operator<< Function

CodeFormatter & soulng::util::operator<<(CodeFormatter & f, int64_t x)

Definition at line 197 of CodeFormatter.cpp :
198 {
199     f.Write(std::to_string(x));
200     return f;
201 }


Declaration at line 70 of CodeFormatter.hpp

Calls: soulng::util::CodeFormatter::Write


operator<< Function

CodeFormatter & soulng::util::operator<<(CodeFormatter & f, uint64_t x)

Definition at line 203 of CodeFormatter.cpp :
204 {
205     f.Write(std::to_string(x));
206     return f;
207 }


Declaration at line 71 of CodeFormatter.hpp

Calls: soulng::util::CodeFormatter::Write


operator<< Function

LogFileWriter & soulng::util::operator<<(LogFileWriter & writer, bool b)

Definition at line 74 of LogFileWriter.cpp
Declaration at line 36 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::Write


operator<< Function

LogFileWriter & soulng::util::operator<<(LogFileWriter & writer, char c)

Definition at line 68 of LogFileWriter.cpp :
 69 {
 70     writer.Write(std::string(1c));
 71     return writer;
 72 }


Declaration at line 35 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::Write


operator<< Function

LogFileWriter & soulng::util::operator<<(LogFileWriter & writer, const char * s)

Definition at line 62 of LogFileWriter.cpp :
 63 {
 64     writer.Write(s);
 65     return writer;
 66 }


Declaration at line 34 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::Write


operator<< Function

LogFileWriter & soulng::util::operator<<(LogFileWriter & writer, const std::string& s)

Definition at line 56 of LogFileWriter.cpp :
 57 {
 58     writer.Write(s);
 59     return writer;
 60 }


Declaration at line 33 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::Write


operator<< Function

LogFileWriter & soulng::util::operator<<(LogFileWriter & writer, double x)

Definition at line 94 of LogFileWriter.cpp :
 95 {
 96     writer.Write(std::to_string(x));
 97     return writer;
 98 }


Declaration at line 38 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::Write


operator<< Function

LogFileWriter & soulng::util::operator<<(LogFileWriter & writer, int x)

Definition at line 88 of LogFileWriter.cpp :
 89 {
 90     writer.Write(std::to_string(x));
 91     return writer;
 92 }


Declaration at line 37 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::Write


operator<< Function

LogFileWriter & soulng::util::operator<<(LogFileWriter & writer, int64_t x)

Definition at line 100 of LogFileWriter.cpp :
101 {
102     writer.Write(std::to_string(x));
103     return writer;
104 }


Declaration at line 39 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::Write


operator<< Function

LogFileWriter & soulng::util::operator<<(LogFileWriter & writer, uint64_t x)

Definition at line 106 of LogFileWriter.cpp :
107 {
108     writer.Write(std::to_string(x));
109     return writer;
110 }


Declaration at line 40 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::Write


operator<= Function

bool soulng::util::operator<=(const Date & left, const Date & right) inline

Definition at line 70 of Time.hpp :
 71 {
 72     return !(right > left);
 73 }



operator<= Function

bool soulng::util::operator<=(const DateTime & left, const DateTime & right) inline

Definition at line 133 of Time.hpp :
134 {
135     return !(right > left);
136 }



operator<= Function

bool soulng::util::operator<=(const Timestamp & left, const Timestamp & right) inline

Definition at line 177 of Time.hpp :
178 {
179     return !(right > left);
180 }



operator== Function

bool soulng::util::operator==(StringPtr left, StringPtr right) inline

Definition at line 35 of String.hpp

Calls: soulng::util::StringPtr::Value


operator== Function

bool soulng::util::operator==(const Date & left, const Date & right)

Definition at line 167 of Time.cpp :
168 {
169     return left.Year() == right.Year() && left.GetMonth() == right.GetMonth() && left.Day() == right.Day();
170 }


Declaration at line 56 of Time.hpp

Calls: soulng::util::Date::Day , soulng::util::Date::GetMonth , soulng::util::Date::Year


operator== Function

bool soulng::util::operator==(const DateTime & left, const DateTime & right)

Definition at line 308 of Time.cpp :
309 {
310     return left.GetDate() == right.GetDate() && left.Seconds() == right.Seconds();
311 }


Declaration at line 119 of Time.hpp

Calls: soulng::util::DateTime::GetDate , soulng::util::DateTime::Seconds


operator== Function

bool soulng::util::operator==(const Timestamp & left, const Timestamp & right)

Definition at line 376 of Time.cpp :
377 {
378     return left.GetDateTime() == right.GetDateTime() && left.Nanoseconds() == right.Nanoseconds();
379 }


Declaration at line 163 of Time.hpp

Calls: soulng::util::Timestamp::GetDateTime , soulng::util::Timestamp::Nanoseconds


operator> Function

bool soulng::util::operator>(const Date & left, const Date & right) inline

Definition at line 65 of Time.hpp :
 66 {
 67     return right < left;
 68 }



operator> Function

bool soulng::util::operator>(const DateTime & left, const DateTime & right) inline

Definition at line 128 of Time.hpp :
129 {
130     return right < left;
131 }



operator> Function

bool soulng::util::operator>(const Timestamp & left, const Timestamp & right) inline

Definition at line 172 of Time.hpp :
173 {
174     return right < left;
175 }



operator>= Function

bool soulng::util::operator>=(const Date & left, const Date & right) inline

Definition at line 75 of Time.hpp :
 76 {
 77     return !(left < right);
 78 }



operator>= Function

bool soulng::util::operator>=(const DateTime & left, const DateTime & right) inline

Definition at line 138 of Time.hpp :
139 {
140     return !(left < right);
141 }



operator>= Function

bool soulng::util::operator>=(const Timestamp & left, const Timestamp & right) inline

Definition at line 182 of Time.hpp :
183 {
184     return !(left < right);
185 }



operator| Function

Redirections soulng::util::operator|(Redirections left, Redirections right) constexpr

Definition at line 43 of Process.hpp :
44 {
45     return Process::Redirections(int(left) | int(right));
46 }



top | up | prev | next