-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Marcus Boerger edited this page Jun 7, 2023
·
2 revisions
This C++20 library provides some general useful building blocks and integrates with Google's Abseil library.
The C++ library is organized in functional groups each residing in their own directory.
- Diff
namespacembo::diff
- mbo/diff:unified_dff_cc, mbo/diff/unified_diff.h
- class
UnifiedDiff
: A class that implements unified-diffing.
- class
- mbo/diff:unified_diff
- binary
unfied_diff
: A binary that performs a unified-diff on two files.
- binary
- mbo/diff:diff.bzl
- bzl-macro
difftest
: A test rule that compares an output versus a golden file.
- bzl-macro
- Files
namespace mbo::files
- mbo/file:artefact_cc, mbo/file/artefact.h
- struct
Artefact
: Holds information about a file (its data content, name, and modified time).
- struct
- mbo/file:file_cc, mbo/file.file.h
- function
GetContents
: Reads a file and returns its contents or an absl::Status error. - function
GetMTime
: Returns the last update/modified time of a file or an absl::Status error. - function
IsAbsolutePath
: Returns whether a given path is absolute. - function
JoinPaths
: Join multiple path elements. - function
NormalizePath
: Normalizes a path. - function
Readable
: Returns whether a file is readable or an absl::Status error. - function
SetContents
: Writes contents to a file.
- function
- Strings
namespace mbo::strings
- mbo/strings:indent_cc, mbo/strings/indent.h
- function
DropIndent
: Converts a raw-string text block as if it had no indent. - function
DropIndentAndSplit
: Variant ofDropIndent
that returns the result as lines.
- function
- Testing
namespace mbo::testing
- mbo/testing:status_cc, mbo/testing/status.h
- gMock-matcher
IsOk
: Tests whether an absl::Status or absl::StatusOr is absl::OkStatus. - gMock-matcher
IsOkAndHolds
: Tests an absl::StatusOr for absl::OkStatus and contents. - gMock-Matcher
StatusIs
: Tests an absl::Status or absl::StatusOr against a specific status code and message.
- gMock-matcher
- Types
namespace mbo::types
- mbo/types:cases_cc, mbo/types/cases.h
- meta-type
Cases
: Allows to switch types based on conditions. - meta-type
CaseIndex
: Evaluates the first non zero case (1-based, 0 if all zero). - meta-type
IfThen
: Helper type to generate if-thenCases
types. - meta-type
IfElse
: Helper type to generate elseCases
which are always true and must go last. - meta-type
IfFalseThenVoid
: Helper type that can be used to skip a case. - meta-type
IfTrueThenVoid
: Helper type to inject default cases and to ensure the required type expansion is always possible.
- meta-type
- mbo/types:extend_cc, mbo/types/extend.h
- crtp-struct
Extend
: Enables extending of struct/classe types with basic functionality. - crtp-struct
ExtendNoDefault
LikeExtend
but without default extender functionality. -
namespace extender
- extender-struct
AbslFormat
: Extender that injects functionality to make anExtend
ed type work with abseil format/print functions. - extender-struct
AbslHashable
: Extender that injects functionality to make anExtend
ed type work with abseil hashing (and alsostd::hash
). - extender-struct
Comparable
: Extender that injects functionality to make anExtend
ed type comparable. All comparators will be injected:<=>
,==
,!=
,<
,<=
,>
,>=
. - extender-struct
Printable
: Extender that injects functionality to make anExtend
ed type get aPrint
function which can be used to convert a type into astd::string
. - extender-struct
Streamable
: Extender that injects functionality to make anExtend
ed type streamable. This allows the type to be used directly withstd::ostream
s.
- extender-struct
- crtp-struct
- mbo/types:tstring_cc, mbo/types/tstring.h
- struct
tstring
: Implements typetstring
a compile time string-literal type. - operator
operator"" _ts
: String literal support for Clang, GCC and derived compilers.
- struct
In addition some Bazel macros are implemented that are not direct part of the library:
- bzl:archive.bzl
-
http_archive
: Simple wrapper that tests whether the archive was already loaded. -
github_archive
: Specialized archive wrapper that supports github that supportstagged
releases or commits.
-