8#ifndef SEN_LIBS_GEN_SRC_COMMON_UTIL_H
9#define SEN_LIBS_GEN_SRC_COMMON_UTIL_H
16#include <inja/environment.hpp>
38[[nodiscard]] std::vector<std::string>
tokenize(
const std::string& str,
const char delim);
41[[nodiscard]] std::string
prepend(
const std::string& prefix,
const std::string str);
44[[nodiscard]] std::string
append(
const std::string& lhs,
const std::string rhs);
47[[nodiscard]] std::string
capitalize(
const std::string& str);
50[[nodiscard]] std::string
capitalize(std::string_view str);
70 std::stringstream stream;
71 stream <<
"0x" << std::setfill(
'0') << std::setw(
sizeof(T) +
sizeof(T)) << std::hex << i;
78 std::stringstream stream;
79 stream <<
"0x" << std::setfill(
'0') << std::setw(
sizeof(T)) << std::hex << i;
Represents a user-defined type.
Definition custom_type.h:23
The set of types used during resolution.
Definition stl_resolver.h:51
A set of types coming from a STL file.
Definition stl_resolver.h:33
Definition gen/src/common/util.h:30
constexpr std::size_t maxCommentLineLength
Definition gen/src/common/util.h:31
Definition type_storage.h:28
std::string intToHex2(T i)
Definition gen/src/common/util.h:76
std::string append(const std::string &lhs, const std::string rhs)
Appends a suffix to the end of a given string.
std::string intToHex(T i)
Definition gen/src/common/util.h:68
std::string capitalize(const std::string &str)
Transform a string to uppercase.
std::string prepend(const std::string &prefix, const std::string str)
Appends a prefix to the beginning of a given string.
std::vector< const sen::lang::TypeSet * > collectAllTypeSets(const sen::lang::TypeSetContext &typeSets)
Walks the given context's type sets and their imports depth-first, returning unique sets in insertion...
void configureEnv(inja::Environment &env)
Registers inja helper callbacks used by generator templates.
std::string computeCppNamespace(const std::vector< std::string > &package)
Computes C++ namespace from a string package.
std::vector< std::string > tokenize(const std::string &str, const char delim)
Splits a string into substrings by a delimiter, skipping empty results.