Classes | |
class | Application |
Application-level control. More... | |
class | Base |
Non-virtual base class from which NOCL objects may inherit. More... | |
class | Box |
Container for aligning and sizing components into a rectangular area. More... | |
class | Button |
Base class for various types of buttons. More... | |
class | ButtonBox |
Container for aligning and sizing buttons the same way. More... | |
class | ButtonHandler |
Event handler for nocl::Button events. More... | |
class | Container |
Base class for all GUI components that act as containers. More... | |
class | EventHandler |
Base class for event handling. More... | |
class | Exception |
Exception class that inherits from the standard C++ class std:exception . More... | |
class | Fixed |
Fixed layout. More... | |
class | Flexbox |
Flexbox layout engine. More... | |
class | FlexItem |
Item used with the Flexbox layout engine. More... | |
class | FrameWindow |
Top level frame window. More... | |
class | Grid |
Container which arranges children using a grid of columns and rows. More... | |
class | GUIComponent |
Base class for all GUI components. More... | |
class | Label |
Text label. More... | |
class | Layout |
Blank layout. More... | |
class | Logfile |
Text log file. More... | |
class | Point |
The position (x and y offsets) associated with an object. More... | |
class | Size |
The size (width and height) associated with an object. More... | |
class | SpinButton |
Entryfield with buttons to increment or decrement the value in the text field. More... | |
class | TextButton |
Traditional text pushbutton. More... | |
class | TextEditor |
Multi-line text editor. More... | |
class | TextField |
Single line text editor/entryfield. More... | |
class | ToggleSwitch |
On/off toggle switch. More... | |
class | VBase |
Virtual base class from which NOCL objects may inherit. More... | |
class | Window |
Window with a frame. More... | |
Typedefs | |
typedef uint64_t | Bytes |
A large unsigned number type which can be used to represent a number of bytes. More... | |
typedef std::map< GtkWidget *, GUIComponent * > | WidgetToGUIComponentMap |
Map Gtk+ widgets to NOCL GUI components. More... | |
typedef std::vector< std::string > | VStr |
Vector of text strings. More... | |
typedef std::map< std::string, std::string > | MStr |
Map of string-to-string, where both the key and the value are std::string . More... | |
typedef std::vector< FlexItem > | VFlexItems |
typedef std::multimap< size_t, FlexItem > | MMFlexItems |
Functions | |
std::string | approximate_si_bytes (const Bytes b) |
Describe the approximate number of bytes as a text string, using the standard decimal SI units. More... | |
std::string | approximate_iec_bytes (const Bytes b) |
Describe the approximate number of bytes as a text string, using the standard binary IEC units. More... | |
std::string | version (void) |
Get a simple version string for NOCL. For example, may return "0.1.0" . More... | |
std::string | timestamp_str (void) |
Create a timestamp with the current time. More... | |
std::string | demangle_function_name (std::string name) |
Attempt to demangle the C++ function name. Used by call_stack(). More... | |
VStr | call_stack (const size_t idx=1) |
Get the call stack as a vector of text strings. More... | |
std::string | shorten_path_for_display (std::string path) |
Possibly shorten a path so it contains less components. More... | |
Bytes | KB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | MB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | GB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | TB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | PB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | KB (const int b) |
Bytes | MB (const int b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | GB (const int b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | TB (const int b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | PB (const int b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | KB (const double b) |
Bytes | MB (const double b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | GB (const double b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | TB (const double b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | PB (const double b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | KiB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | MiB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | GiB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | TiB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | PiB (const Bytes b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | KiB (const int b) |
Bytes | MiB (const int b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | GiB (const int b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | TiB (const int b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | PiB (const int b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | KiB (const double b) |
Bytes | MiB (const double b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | GiB (const double b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | TiB (const double b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
Bytes | PiB (const double b) |
Convert the given number to kilobytes, megabytes, etc. More... | |
typedef uint64_t nocl::Bytes |
A large unsigned number type which can be used to represent a number of bytes.
For example:
nocl::Bytes
is unsigned and cannot be used to represent negative values!typedef std::map<GtkWidget*, GUIComponent*> nocl::WidgetToGUIComponentMap |
Map Gtk+ widgets to NOCL GUI components.
typedef std::vector<std::string> nocl::VStr |
Vector of text strings.
typedef std::map<std::string, std::string> nocl::MStr |
Map of string-to-string, where both the key and the value are std::string
.
typedef std::vector<FlexItem> nocl::VFlexItems |
typedef std::multimap<size_t, FlexItem> nocl::MMFlexItems |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
Referenced by KB(), MB(), and PB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References KB().
Referenced by GB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References MB().
Referenced by TB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References GB().
Referenced by PB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
nocl::Bytes nocl::KB | ( | const int | b | ) |
nocl::Exception | Will throw if the value being converted to nocl::Bytes is negative. |
References KB(), and NOCL_WHERE.
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References KB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References MB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References GB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
nocl::Bytes nocl::KB | ( | const double | b | ) |
nocl::Exception | Will throw if the value being converted to nocl::Bytes is negative. |
References NOCL_WHERE.
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References KB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References MB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References GB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References TB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
Referenced by KiB(), MiB(), and PiB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References KiB().
Referenced by GiB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References MiB().
Referenced by TiB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References GiB().
Referenced by PiB().
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
nocl::Bytes nocl::KiB | ( | const int | b | ) |
nocl::Exception | Will throw if the value being converted to nocl::Bytes is negative. |
References KiB(), and NOCL_WHERE.
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References KiB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References MiB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References GiB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
nocl::Bytes nocl::KiB | ( | const double | b | ) |
nocl::Exception | Will throw if the value being converted to nocl::Bytes is negative. |
References NOCL_WHERE.
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References KiB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References MiB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References GiB().
|
inline |
Convert the given number to kilobytes, megabytes, etc.
Several examples:
Input | Output |
---|---|
KB(0) | 0 |
KB(3) | 3000 |
KiB(3) | 3072 |
MB(2) | 2000000 |
MiB(2) | 2097152 |
KB (0.75) | 750 |
KiB (0.75) | 768 |
TB (0.5) | 500000000000 |
TiB (0.5) | 549755813888 |
References approximate_iec_bytes(), approximate_si_bytes(), and TiB().
std::string nocl::approximate_si_bytes | ( | const Bytes | b | ) |
Describe the approximate number of bytes as a text string, using the standard decimal SI units.
The resulting string should be easy to read, at a cost of lost accuracy. The decimal SI units are KB, MB, GB, etc, where the base unit of measurement is 1000.
Several examples:
Input | Output for approximate_si_bytes () | Output for approximate_iec_bytes () |
---|---|---|
0 | "0 bytes" | "0 bytes" |
1 | "1 byte" | "1 byte" |
1000 | "1 KB" | "0.98 KiB" |
1024 | "1.02 KB" | "1 KiB" |
1000000 | "1 MB" | "0.95 MiB" |
1048576 | "1.05 MB" | "1 MiB" |
750000000 | "0.75 GB" | "0.7 GiB" |
805306368 | "0.81 GB" | "0.75 GiB" |
Referenced by PiB().
std::string nocl::approximate_iec_bytes | ( | const Bytes | b | ) |
Describe the approximate number of bytes as a text string, using the standard binary IEC units.
The resulting string should be easy to read, at a cost of lost accuracy. The binary IEC units are KiB, MiB, GiB, etc, where the base unit of measurement is 1024.
Several examples:
Input | Output for approximate_si_bytes () | Output for approximate_iec_bytes () |
---|---|---|
0 | "0 bytes" | "0 bytes" |
1 | "1 byte" | "1 byte" |
1000 | "1 KB" | "0.98 KiB" |
1024 | "1.02 KB" | "1 KiB" |
1000000 | "1 MB" | "0.95 MiB" |
1048576 | "1.05 MB" | "1 MiB" |
750000000 | "0.75 GB" | "0.7 GiB" |
805306368 | "0.81 GB" | "0.75 GiB" |
Referenced by nocl::Logfile::get(), and PiB().
std::string nocl::version | ( | void | ) |
Get a simple version string for NOCL. For example, may return "0.1.0"
.
std::string nocl::timestamp_str | ( | void | ) |
Create a timestamp with the current time.
For example: "2018-04-16 23:40:48"
Referenced by nocl::Logfile::get(), and nocl::Logfile::ts().
std::string nocl::demangle_function_name | ( | std::string | name | ) |
Attempt to demangle the C++ function name. Used by call_stack().
Referenced by call_stack().
nocl::VStr nocl::call_stack | ( | const size_t | idx = 1 | ) |
Get the call stack as a vector of text strings.
[in] | idx | The last few calls on the stack may be skipped by specifying a non-zero value for idx . For example, if you don't want call_stack() itself appearing in the vector, then call with idx set to 1. |
References demangle_function_name(), and shorten_path_for_display().
std::string nocl::shorten_path_for_display | ( | std::string | path | ) |
Possibly shorten a path so it contains less components.
If the path has too many components, remove the first one and test again to see if it is still too long.
For example, a path like this:
/home/stephane/projects/nocl/build/tests/core/nocl_core_tests
...will get shortened to this:
tests/core/nocl_core_tests
The original string is not modified. Note that path wont be valid anymore, but it makes it easier to read.
Referenced by call_stack(), and nocl::Exception::details().