cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
stat_bench::util Namespace Reference

Namespace of utility functions and classes. More...

Classes

class  ISyncBarrier
 Interface of barriers to synchronize threads. More...
 
class  OrderedMap
 Class of mapping which preserves order of insertion. More...
 
class  PthreadSyncBarrier
 Class of barriers to synchronize threads using pthread library. More...
 
class  StringView
 Class of view of strings. More...
 
class  Utf8String
 Class of UTF-8 encoded string. More...
 
class  WindowsSyncBarrier
 Class of barriers to synchronize threads using synchronization barriers in Windows. More...
 

Functions

auto check_glob_pattern (StringView pattern, StringView str) -> bool
 Check whether a string matches with a glob pattern.
 
auto create_mutex_sync_barrier (std::size_t num_waiting_threads) -> std::shared_ptr< ISyncBarrier >
 Create a barrier to synchronize threads using a mutex.
 
auto create_sync_barrier (std::size_t num_waiting_threads) -> std::shared_ptr< ISyncBarrier >
 Create a barrier to synchronize threads.
 
auto escape_for_file_name (const Utf8String &input) -> Utf8String
 Escape a string for a file name.
 
auto escape_for_html (const StringView &input) -> std::string
 Escape a string for HTML.
 
auto operator!= (const Utf8String &lhs, const Utf8String &rhs) noexcept -> bool
 Compare two Utf8String objects.
 
auto operator< (const Utf8String &lhs, const Utf8String &rhs) noexcept -> bool
 Compare two Utf8String objects.
 
auto operator<< (std::ostream &stream, const Utf8String &val) -> std::ostream &
 Format to a stream.
 
auto operator<= (const Utf8String &lhs, const Utf8String &rhs) noexcept -> bool
 Compare two Utf8String objects.
 
auto operator== (const Utf8String &lhs, const Utf8String &rhs) noexcept -> bool
 Compare two Utf8String objects.
 
auto operator> (const Utf8String &lhs, const Utf8String &rhs) noexcept -> bool
 Compare two Utf8String objects.
 
auto operator>= (const Utf8String &lhs, const Utf8String &rhs) noexcept -> bool
 Compare two Utf8String objects.
 
void prepare_directory (const std::string &path)
 Prepare a directory.
 
void prepare_directory_for (const std::string &path)
 Prepare a directory for a file.
 

Detailed Description

Namespace of utility functions and classes.

Function Documentation

◆ check_glob_pattern()

auto stat_bench::util::check_glob_pattern ( StringView pattern,
StringView str ) -> bool
nodiscard

Check whether a string matches with a glob pattern.

Parameters
[in]patternGlob pattern.
[in]strString.
Return values
trueThe input string matches with the glob pattern.
falseThe input string doesn't match with the glob pattern.

Definition at line 44 of file check_glob_pattern.cpp.

◆ create_mutex_sync_barrier()

auto stat_bench::util::create_mutex_sync_barrier ( std::size_t num_waiting_threads) -> std::shared_ptr<ISyncBarrier>
nodiscard

Create a barrier to synchronize threads using a mutex.

Parameters
[in]num_waiting_threadsNumber of threads to wait.
Returns
Barrier.
Warning
This function exists for testing purpose only.

Definition at line 103 of file sync_barrier.cpp.

◆ create_sync_barrier()

auto stat_bench::util::create_sync_barrier ( std::size_t num_waiting_threads) -> std::shared_ptr<ISyncBarrier>
nodiscard

Create a barrier to synchronize threads.

Parameters
[in]num_waiting_threadsNumber of threads to wait.
Returns
Barrier.

Definition at line 108 of file sync_barrier.cpp.

◆ escape_for_file_name()

auto stat_bench::util::escape_for_file_name ( const Utf8String & input) -> Utf8String
nodiscard

Escape a string for a file name.

Parameters
[in]inputInput string.
Returns
Escaped string.

Definition at line 81 of file escape_for_file_name.cpp.

◆ escape_for_html()

auto stat_bench::util::escape_for_html ( const StringView & input) -> std::string
nodiscard

Escape a string for HTML.

Parameters
[in]inputInput string.
Returns
Escaped string.

Definition at line 29 of file escape_for_html.cpp.

◆ operator!=()

auto stat_bench::util::operator!= ( const Utf8String & lhs,
const Utf8String & rhs ) -> bool
nodiscardnoexcept

Compare two Utf8String objects.

Parameters
[in]lhsLeft-hand side object.
[in]rhsRight-hand side object.
Return values
trueThe two objects are not equal.
falseThe two objects are equal.

Definition at line 45 of file utf8_string.cpp.

◆ operator<()

auto stat_bench::util::operator< ( const Utf8String & lhs,
const Utf8String & rhs ) -> bool
nodiscardnoexcept

Compare two Utf8String objects.

Parameters
[in]lhsLeft-hand side object.
[in]rhsRight-hand side object.
Return values
trueThe left-hand side object is less than the right-hand side object.
falseThe left-hand side object is not less than the right-hand side object.

Definition at line 49 of file utf8_string.cpp.

◆ operator<<()

auto stat_bench::util::operator<< ( std::ostream & stream,
const Utf8String & val ) -> std::ostream&

Format to a stream.

Parameters
[in,out]streamStream.
[in]valValue.
Returns
Stream.

Definition at line 81 of file utf8_string.cpp.

◆ operator<=()

auto stat_bench::util::operator<= ( const Utf8String & lhs,
const Utf8String & rhs ) -> bool
nodiscardnoexcept

Compare two Utf8String objects.

Parameters
[in]lhsLeft-hand side object.
[in]rhsRight-hand side object.
Return values
trueThe left-hand side object is less than or equal to the right-hand side object.
falseThe left-hand side object is greater than the right-hand side object.

Definition at line 57 of file utf8_string.cpp.

◆ operator==()

auto stat_bench::util::operator== ( const Utf8String & lhs,
const Utf8String & rhs ) -> bool
nodiscardnoexcept

Compare two Utf8String objects.

Parameters
[in]lhsLeft-hand side object.
[in]rhsRight-hand side object.
Return values
trueThe two objects are equal.
falseThe two objects are not equal.

Definition at line 41 of file utf8_string.cpp.

◆ operator>()

auto stat_bench::util::operator> ( const Utf8String & lhs,
const Utf8String & rhs ) -> bool
nodiscardnoexcept

Compare two Utf8String objects.

Parameters
[in]lhsLeft-hand side object.
[in]rhsRight-hand side object.
Return values
trueThe left-hand side object is less than or equal to the right-hand side object.
falseThe left-hand side object is greater than the right-hand side object.

Definition at line 53 of file utf8_string.cpp.

◆ operator>=()

auto stat_bench::util::operator>= ( const Utf8String & lhs,
const Utf8String & rhs ) -> bool
nodiscardnoexcept

Compare two Utf8String objects.

Parameters
[in]lhsLeft-hand side object.
[in]rhsRight-hand side object.
Return values
trueThe left-hand side object is greater than or equal to the right-hand side object.
falseThe left-hand side object is less than the right-hand side object.

Definition at line 61 of file utf8_string.cpp.

◆ prepare_directory()

void stat_bench::util::prepare_directory ( const std::string & path)

Prepare a directory.

Parameters
[in]pathDirectory path.

Definition at line 89 of file prepare_directory.cpp.

◆ prepare_directory_for()

void stat_bench::util::prepare_directory_for ( const std::string & path)

Prepare a directory for a file.

Parameters
[in]pathDirectory path.

Definition at line 115 of file prepare_directory.cpp.