16 #include <unordered_map>
27 #include "toolkitdef.h"
38 void LogDebug(
const char *fmt, ...);
39 void LogError(
const char *fmt, ...);
40 void LogInfo(
const char *fmt, ...);
41 void LogWarning(
const char *fmt, ...);
46 extern std::vector<std::string> logBuffer;
47 bool LogBufferContains(
const std::string &s);
48 void LogString(std::string message, LogLevel level);
53 LogLevel StrToLogLevel(
const std::string &level);
58 bool ApproximatelyEqual(
double firstVal,
double secondVal);
63 bool IsValidInteger(
const std::string &value);
68 bool IsValidDouble(
const std::string &value);
73 bool IsDigits(
const std::string &value);
78 std::string ExtractIDFragment(std::string refID);
83 std::string UTF32to8(
const std::u32string &in);
88 std::u32string UTF8to32(
const std::string &in);
93 std::string UTF16to8(
const std::u16string &in);
99 std::string StringFormat(
const char *fmt, ...);
101 std::string StringFormatVariable(
const char *format, va_list arg);
107 std::string GetFileVersion(
int vmaj,
int vmin,
int vrev);
112 std::string GetFilename(std::string fullpath);
117 std::string GetVersion();
123 std::string BaseEncodeInt(uint32_t value, uint8_t base);
128 std::string FromCamelCase(
const std::string &s);
133 std::string ToCamelCase(
const std::string &s);
138 inline data_DURATION DurationMin(data_DURATION dur1, data_DURATION dur2)
140 return std::min(dur1, dur2);
142 inline data_DURATION DurationMax(data_DURATION dur1, data_DURATION dur2)
144 return std::max(dur1, dur2);
150 extern LogLevel logLevel;
151 extern bool loggingToBuffer;
164 extern struct timeval start;
165 void LogElapsedTimeStart();
166 void LogElapsedTimeStop(
const char *msg =
"unspecified operation");
172 bool IsMensuralType(data_NOTATIONTYPE notationType);
173 bool IsNeumeType(data_NOTATIONTYPE notationType);
174 bool IsTabType(data_NOTATIONTYPE notationType);
180 std::string Base64Encode(
unsigned char const *bytesToEncode,
unsigned int len);
181 std::vector<unsigned char> Base64Decode(std::string
const &encodedString);