Classes | |
class | Animation |
Manages an animation, which is a collection of keyframes and the ability to interpolate between the keyframes. More... | |
class | AssimpLoader |
Class used to load mesh files using the assimp lodaer. More... | |
class | AudioDecoder |
An audio decoder based on FFMPEG. More... | |
class | Base64 |
class | Battery |
A battery abstraction. More... | |
class | BVHLoader |
Handles loading BVH animation files. More... | |
class | ColladaExporter |
Class used to export Collada mesh files. More... | |
struct | ColladaLight |
This struct contains light data specifically for collada export Defaults set based on collada 1.4 specifications. More... | |
class | ColladaLoader |
Class used to load Collada mesh files. More... | |
class | Connection |
A class that encapsulates a connection. More... | |
class | Console |
Container for loggers, and global logging options (such as verbose vs. quiet output). More... | |
struct | CSVDialect |
A CSV specification. More... | |
class | CSVIStreamIterator |
A single-pass row iterator on an input stream of CSV data. More... | |
struct | CSVToken |
A token in CSV data. More... | |
class | DataFrame |
An abstract data frame. More... | |
class | Dem |
class | DirIter |
A class for iterating over all items in a directory. More... | |
class | Event |
Base class for all events. More... | |
class | EventT |
A class for event processing. More... | |
class | FlagSet |
Set of flags defined by a C++11 enum class. More... | |
class | HeightmapData |
Encapsulates a generic heightmap data file. More... | |
class | HWEncoder |
Representation of a GPU video encoder and its configuration. More... | |
class | Image |
Encapsulates an image. More... | |
class | ImageHeightmap |
Encapsulates an image that will be interpreted as a heightmap. More... | |
struct | IO |
Traits for type-specific object I/O. More... | |
struct | IO< DataFrame< K, math::InMemoryTimeVaryingVolumetricGrid< T, V, P > > > |
Traits for IO of data frames comprised of time varying volumetric grids. More... | |
struct | IO< std::string > |
Traits for string I/O. More... | |
struct | IsEnumThatContainsSentinel |
struct | IsEnumThatContainsSentinel< T, decltype(static_cast< void >(T::_))> |
class | KeyEvent |
Generic description of a keyboard event. More... | |
class | KeyFrame |
A key frame in an animation. More... | |
class | LogMessage |
Helper class for providing gzlog macros. More... | |
class | Material |
Encapsulates description of a material. More... | |
class | MaterialDensity |
Encapsulates density types. More... | |
class | Mesh |
A 3D mesh. More... | |
class | MeshExporter |
Base class for exporting meshes. More... | |
class | MeshLoader |
Base class for loading meshes. More... | |
class | MeshManager |
Maintains and manages all meshes. Supported mesh formats are STL (STLA, STLB), COLLADA, OBJ, GLTF (GLB) and FBX. By default only GLTF and FBX are loaded using assimp loader, however if GZ_MESH_FORCE_ASSIMP environment variable is set, then MeshManager will use assimp loader for all supported mesh formats. More... | |
class | MouseEvent |
Generic description of a mouse event. More... | |
class | MovingWindowFilter |
Base class for MovingWindowFilter. More... | |
class | NodeAnimation |
Node animation. More... | |
class | NodeAssignment |
Vertex to node weighted assignment for skeleton animation visualization. More... | |
class | NodeTransform |
A transformation node. More... | |
class | NumericAnimation |
A numeric animation. More... | |
class | NumericKeyFrame |
A keyframe for a NumericAnimation. More... | |
class | OBJLoader |
Class used to load obj mesh files. More... | |
class | Pbr |
This class contains Physically-Based-Rendering (PBR) workflow properties. More... | |
class | PoseAnimation |
A pose animation. More... | |
class | PoseKeyFrame |
A keyframe for a PoseAnimation. More... | |
class | Profiler |
Used to perform application-wide performance profiling. More... | |
class | ScopedProfile |
Used to provide C++ RAII-style profiling sample. The sample will start on the construction of the ScopedProfile object and stop when the object leaves scope. More... | |
class | SignalHandler |
Register callbacks that get triggered on SIGINT and SIGTERM. More... | |
class | SingletonT |
Singleton template class. More... | |
class | Skeleton |
A skeleton, usually used for animation purposes. More... | |
class | SkeletonAnimation |
Skeleton animation. More... | |
class | SkeletonNode |
A skeleton node. More... | |
class | STLLoader |
Class used to load STL mesh files. More... | |
class | SubMesh |
A child mesh. More... | |
class | SVGCommand |
SVG command data structure. More... | |
class | SVGLoader |
A loader for SVG files. More... | |
struct | SVGPath |
An SVG path element data structure. More... | |
class | SystemPaths |
Functions to handle getting system paths, keeps track of: More... | |
class | TempDirectory |
Create a temporary directory in the OS temp location. Upon construction, the current working directory will be set to this new temporary directory. Upon destruction, the current working directory will be restored to the location when the TempDirectory object was constructed. More... | |
class | Timer |
A timer class, used to time things in real world walltime. More... | |
class | TrajectoryInfo |
Information about a trajectory for an animation (e.g., Actor) This contains the keyframe information. More... | |
class | URI |
A complete URI which has the following components: More... | |
class | URIAuthority |
class | URIFragment |
The fragment component of a URI. More... | |
class | URIPath |
A URI path contains a sequence of segments separated by / . The path may be empty in a valid URI. When an authority is present, the path must start with a / . More... | |
class | URIQuery |
The query component of a URI. More... | |
class | Uuid |
A portable class for representing a Universally Unique Identifier. More... | |
class | Video |
Handle video encoding and decoding using libavcodec. More... | |
class | VideoEncoder |
The VideoEncoder class supports encoding a series of images to a video format, and then writing the video to disk. More... | |
class | WorkerPool |
A pool of worker threads that do stuff in parallel. More... | |
Typedefs | |
typedef std::shared_ptr< Battery > | BatteryPtr |
using | ConnectionPtr = std::shared_ptr< Connection > |
template<typename To , typename From > | |
using | ConstCompatible = detail::ConstCompatible< To, From > |
Contains a static constexpr field named value which will be true if the type From has a const-quality less than or equal to the type To . | |
typedef std::runtime_error | exception |
A runtime error. | |
using | MaterialPtr = std::shared_ptr< Material > |
using | MeshPtr = std::shared_ptr< Mesh > |
typedef std::map< unsigned int, SkeletonNode * > | SkeletonNodeMap |
using | SkeletonPtr = std::shared_ptr< Skeleton > |
using | SubMeshPtr = std::shared_ptr< SubMesh > |
Enumerations | |
enum | FilesystemWarningOp { FSWO_LOG_WARNINGS = 0 , FSWO_SUPPRESS_WARNINGS } |
Options for how to handle errors that occur in functions that manipulate the filesystem. More... | |
enum | NodeTransformType { TRANSLATE , ROTATE , SCALE , MATRIX } |
Enumeration of the transform types. More... | |
enum class | NormalMapSpace : int { TANGENT = 0 , OBJECT = 1 } |
Space the normal map is defined in. More... | |
enum class | PbrType : int { NONE = 0 , METAL = 1 , SPECULAR = 2 } |
Type of PBR workflow. More... | |
Functions | |
std::string | absPath (const std::string &_path) |
Get the absolute path of a provided path. Relative paths are resolved relative to the current working directory. | |
void | addFindFileURICallback (std::function< std::string(const URI &)> _cb) |
Add a callback to use when findFile() can't find a file that is a valid URI. The callback should return a full local path to the requested file, or and empty string if the file was not found in the callback. Callbacks will be called in the order they were added until a path is found. | |
void | addSearchPathSuffix (const std::string &_suffix) |
add path suffix to common::SystemPaths | |
std::string | av_err2str_cpp (int errnum) |
std::string | basename (const std::string &_path) |
Given a path, get just the basename portion. | |
void | changeFromUnixPath (std::string &_path) |
Replace forward-slashes '/' with the preferred directory separator of the current operating system. On Windows, this will turn forward-slashes into backslashes. If forward-slash is the preferred separator of the current operating system, this will do nothing. | |
void | changeToUnixPath (std::string &_path) |
Replace the preferred directory separator of the current operating system with a forward-slash '/'. On Windows, this will turn backslashes into forward-slashes. | |
bool | chdir (const std::string &_dir) |
Change current working directory to _dir. | |
bool | copyDirectory (const std::string &_existingDirname, const std::string &_newDirname, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS) |
Copy a directory, overwrite the destination directory if exists. | |
bool | copyFile (const std::string &_existingFilename, const std::string &_newFilename, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS) |
Copy a file. | |
std::string | copyFromUnixPath (const std::string &_path) |
Returns a copy of _path which has been passed through changeFromUnixPath. | |
std::string | copyToUnixPath (const std::string &_path) |
Returns a copy of _path which has been passed through changeToUnixPath. | |
bool | createDirectories (const std::string &_path) |
Create directories for the given path. | |
bool | createDirectory (const std::string &_path) |
Create a new directory on the filesystem. Intermediate directories must already exist. | |
std::string | createTempDirectory (const std::string &_baseName, const std::string &_parentPath, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS) |
Create a directory in the tempDirectoryPath by expanding a name template. | |
std::string | cwd () |
Get the current working directory. | |
bool GZ_COMMON_GRAPHICS_VISIBLE | DelaunayTriangulation (const std::vector< gz::math::Vector2d > &_vertices, const std::vector< gz::math::Vector2i > &_edges, SubMesh *_submesh) |
Perform delaunay triangulation on input vertices. | |
bool | EndsWith (const std::string &_s1, const std::string &_s2) |
return true if string ends with another string | |
bool | env (const std::string &_name, std::string &_value) |
Find the environment variable '_name' and return its value. | |
bool | env (const std::string &_name, std::string &_value, bool _allowEmpty) |
Find the environment variable '_name' and return its value. | |
bool | exists (const std::string &_path) |
Determine whether the given path exists on the filesystem. | |
GZ_COMMON_IO_VISIBLE std::istream & | ExtractCSVToken (std::istream &_stream, CSVToken &_token, const CSVDialect &_dialect=CSVDialect::Unix) |
Extract a single token from an input stream of CSV data. | |
std::string | findFile (const std::string &_file) |
search for file in common::SystemPaths | |
std::string | findFile (const std::string &_file, bool _searchLocalPath) |
search for file in common::SystemPaths | |
std::string | findFilePath (const std::string &_file) |
search for a file in common::SystemPaths | |
constexpr uint64_t | hash64 (std::string_view _key) |
fnv1a algorithm for 64-bit platforms. | |
bool | isDirectory (const std::string &_path) |
Determine whether the given path is a directory. | |
bool | isFile (const std::string &_path) |
Check if the given path is a file. | |
bool | isRelativePath (const std::string &_path) |
Check if the given path is relative. | |
std::string | Join (const std::vector< std::string > &_orig, char _delim) |
Join a sequence of strings with a delimiter. | |
std::string | Join (const std::vector< std::string > &_orig, const std::string &_delim) |
Join a sequence of strings with a delimiter. | |
std::string | joinPaths (const std::string &_path) |
base case for joinPaths(...) below | |
std::string | joinPaths (const std::string &_path1, const std::string &_path2) |
Join two strings together to form a path. | |
template<typename... Args> | |
std::string | joinPaths (const std::string &_path1, const std::string &_path2, Args const &..._args) |
Append one or more additional path elements to the first passed in argument. | |
void | load () |
Load external libraries, such as libav. It is safe to call this multiple times. | |
std::string | logPath () |
Get the log path. | |
std::string | lowercase (const char *_in) |
Transforms a string to its lowercase equivalent. | |
std::string | lowercase (const std::string &_in) |
Transforms a string to its lowercase equivalent. | |
void | ltrim (std::string &_s) |
In place left trim. | |
std::string | ltrimmed (std::string _s) |
Copying left trim. | |
bool | moveFile (const std::string &_existingFilename, const std::string &_newFilename, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS) |
Move a file. | |
bool GZ_COMMON_IO_VISIBLE | operator== (const CSVDialect &_lhs, const CSVDialect &_rhs) |
Check CSV dialects for equality. | |
std::string | parentPath (const std::string &_path) |
Given a path, get just its parent path portion, without separator at the end. | |
GZ_COMMON_IO_VISIBLE std::istream & | ParseCSVRow (std::istream &_stream, std::vector< std::string > &_row, const CSVDialect &_dialect=CSVDialect::Unix) |
Parse a single row from an input stream of CSV data. | |
std::string | PluralCast (const std::string &_baseWord, const int _n) |
Choose whether to use a singular or plural version of a noun based on the value of an integer quantity. This version will simply add an 's' character to _baseWord in the event that std::abs(_n) != 1, otherwise it returns _baseWord. | |
std::string | PluralCast (const std::string &_singular, const std::string &_plural, const int _n) |
A version of PluralCast that works for irregular nouns. If std::abs(_n)==1 then _singular is returned; otherwise _plural will be returned. | |
bool | removeAll (const std::string &_path, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS) |
Remove a file or a directory and all its contents. | |
bool | removeDirectory (const std::string &_path, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS) |
Remove an empty directory. | |
bool | removeDirectoryOrFile (const std::string &_path, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS) |
Remove an empty directory or file. | |
bool | removeFile (const std::string &_existingFilename, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS) |
Remove a file. | |
std::string | replaceAll (const std::string &_orig, const std::string &_key, const std::string &_replacement) |
Replace all occurances of _key with _replacement. | |
void | replaceAll (std::string &_result, const std::string &_orig, const std::string &_key, const std::string &_replacement) |
Replace all occurances of _key with _replacement. | |
void | rtrim (std::string &_s) |
In place right trim. | |
std::string | rtrimmed (std::string _s) |
Copying right trim. | |
std::string const | separator (std::string const &_s) |
Append the preferred path separator character for this platform onto the passed-in string. | |
bool | setenv (const std::string &_name, const std::string &_value) |
Set the environment variable '_name'. | |
template<typename T > | |
std::string | sha1 (const T &_buffer) |
Compute the SHA1 hash of an array of bytes. | |
std::string | sha1 (void const *_buffer, std::size_t _byteCount) |
Compute the SHA1 hash of an array of bytes. Use std::string sha1(const T &_buffer) instead of this function. | |
std::vector< std::string > | Split (const std::string &_orig, char _delim) |
split at a one character delimiter to get a vector of something | |
std::vector< std::string > | split (const std::string &_str, const std::string &_delim) |
Splits a string into tokens. | |
bool | StartsWith (const std::string &_s1, const std::string &_s2) |
return true if string starts with another string | |
common::SystemPaths * | systemPaths () |
Get a pointer to the global system paths that is used by all the findFile functions. The returned instance has global shared state for a given process. Care should be taken when manipulating global system paths Caller should not assume ownership of the pointer. | |
std::string | systemTimeISO () |
Please use systemTimeIso() as this function will be deprecated in Gazebo Common 4. Get the wall time as an ISO string: YYYY-MM-DDTHH:MM:SS.NS. | |
std::string | systemTimeIso () |
Get the wall time as an ISO string: YYYY-MM-DDTHH:MM:SS.NS. | |
std::string | tempDirectoryPath () |
Return the path to a directory suitable for temporary files. | |
std::string | timeToIso (const std::chrono::time_point< std::chrono::system_clock > &_time) |
Converts a time point to an ISO string: YYYY-MM-DDTHH:MM:SS.NS. | |
void | trim (std::string &_s) |
In place trim from both ends. | |
std::string | trimmed (std::string _s) |
Copying trim from both ends. | |
std::string | uniqueDirectoryPath (const std::string &_dir) |
Unique directory path to not overwrite existing directory. | |
std::string | uniqueFilePath (const std::string &_pathAndName, const std::string &_extension) |
Generates a path for a file which doesn't collide with existing files, by appending numbers to it (i.e. (0), (1), ...) | |
bool | unsetenv (const std::string &_name) |
Unset the environment variable '_name'. | |
std::string | uuid () |
Get a UUID. | |
Variables | |
static std::string | PixelFormatNames [] |
String names for the pixel formats. | |
Detailed Description
This is an internal-use only class encapsulating HW video encoding. All symbols defined here are hidden from the public API.
Typedef Documentation
◆ BatteryPtr
typedef std::shared_ptr<Battery> BatteryPtr |
◆ ConnectionPtr
using ConnectionPtr = std::shared_ptr<Connection> |
◆ ConstCompatible
using ConstCompatible = detail::ConstCompatible<To, From> |
Contains a static constexpr field named value
which will be true if the type From
has a const-quality less than or equal to the type To
.
The following expressions will return true:
The following expression will return false:
◆ exception
typedef std::runtime_error exception |
A runtime error.
◆ MaterialPtr
using MaterialPtr = std::shared_ptr<Material> |
◆ MeshPtr
using MeshPtr = std::shared_ptr<Mesh> |
◆ SkeletonNodeMap
typedef std::map<unsigned int, SkeletonNode*> SkeletonNodeMap |
◆ SkeletonPtr
using SkeletonPtr = std::shared_ptr<Skeleton> |
◆ SubMeshPtr
using SubMeshPtr = std::shared_ptr<SubMesh> |
Enumeration Type Documentation
◆ FilesystemWarningOp
enum FilesystemWarningOp |
Options for how to handle errors that occur in functions that manipulate the filesystem.
◆ NodeTransformType
enum NodeTransformType |
◆ NormalMapSpace
|
strong |
◆ PbrType
|
strong |
Function Documentation
◆ absPath()
std::string absPath | ( | const std::string & | _path | ) |
Get the absolute path of a provided path. Relative paths are resolved relative to the current working directory.
- Parameters
-
[in] _path Relative or absolute path.
- Returns
- Absolute path (with platform-dependent directory separators).
◆ addFindFileURICallback()
void addFindFileURICallback | ( | std::function< std::string(const URI &)> | _cb | ) |
Add a callback to use when findFile() can't find a file that is a valid URI. The callback should return a full local path to the requested file, or and empty string if the file was not found in the callback. Callbacks will be called in the order they were added until a path is found.
- Parameters
-
[in] _cb The callback function, which takes a file path or URI and returns the full local path.
◆ addSearchPathSuffix()
void addSearchPathSuffix | ( | const std::string & | _suffix | ) |
add path suffix to common::SystemPaths
- Parameters
-
[in] _suffix The suffix to add.
◆ av_err2str_cpp()
|
inline |
References AV_ERROR_MAX_STRING_SIZE.
◆ basename()
std::string basename | ( | const std::string & | _path | ) |
Given a path, get just the basename portion.
- Parameters
-
[in] _path The full path.
- Returns
- A new string with just the basename portion of the path.
◆ changeFromUnixPath()
void changeFromUnixPath | ( | std::string & | _path | ) |
Replace forward-slashes '/' with the preferred directory separator of the current operating system. On Windows, this will turn forward-slashes into backslashes. If forward-slash is the preferred separator of the current operating system, this will do nothing.
Note that this will NOT convert backslashes (or any other separator) into forward slashes, even on operating systems that use forward-slashes as separators.
- Parameters
-
[out] _path This string will be directly modified by replacing its forward-slashes with the preferred directory separator of the current operating system.
◆ changeToUnixPath()
void changeToUnixPath | ( | std::string & | _path | ) |
Replace the preferred directory separator of the current operating system with a forward-slash '/'. On Windows, this will turn backslashes into forward-slashes.
- Parameters
-
[out] _path This string will be directly modified to use forward slashes to separate its directory names.
◆ chdir()
bool chdir | ( | const std::string & | _dir | ) |
Change current working directory to _dir.
- Parameters
-
[in] _dir The directory to change to.
- Returns
- Whether the operation succeeded.
◆ copyDirectory()
bool copyDirectory | ( | const std::string & | _existingDirname, |
const std::string & | _newDirname, | ||
const FilesystemWarningOp | _warningOp = FSWO_LOG_WARNINGS |
||
) |
Copy a directory, overwrite the destination directory if exists.
- Parameters
-
[in] _source Path to an existing directory to copy from. [in] _destination Path to the destination directory.
- Returns
- True on success.
◆ copyFile()
bool copyFile | ( | const std::string & | _existingFilename, |
const std::string & | _newFilename, | ||
const FilesystemWarningOp | _warningOp = FSWO_LOG_WARNINGS |
||
) |
Copy a file.
- Parameters
-
[in] _existingFilename Path to an existing file. [in] _newFilename Path of the new file. [in] _warningOp Log or suppress warnings that may occur.
- Returns
- True on success.
◆ copyFromUnixPath()
std::string copyFromUnixPath | ( | const std::string & | _path | ) |
Returns a copy of _path which has been passed through changeFromUnixPath.
- Parameters
-
[in] _path The path to start with
- Returns
- A modified path that uses the preferred directory separator of the current operating system.
◆ copyToUnixPath()
std::string copyToUnixPath | ( | const std::string & | _path | ) |
Returns a copy of _path which has been passed through changeToUnixPath.
- Parameters
-
[in] _path The path to start with
- Returns
- A modified path that uses forward slashes to separate directory names.
◆ createDirectories()
bool createDirectories | ( | const std::string & | _path | ) |
Create directories for the given path.
- Parameters
-
[in] _path Path to create directories from
- Returns
- true on success
◆ createDirectory()
bool createDirectory | ( | const std::string & | _path | ) |
Create a new directory on the filesystem. Intermediate directories must already exist.
- Parameters
-
[in] _path The new directory path to create
- Returns
- True if directory creation was successful, false otherwise.
◆ createTempDirectory()
std::string createTempDirectory | ( | const std::string & | _baseName, |
const std::string & | _parentPath, | ||
const FilesystemWarningOp | _warningOp = FSWO_LOG_WARNINGS |
||
) |
Create a directory in the tempDirectoryPath by expanding a name template.
On execution, will create the directory: "_parentPath"/"_baseName" + "XXXXXX", where XXXXXX will be filled out by an OS-appropriate method (eg mkdtmp/_mktemp_s)
- Parameters
-
[in] _baseName String to be prepended to the expanded template [in] _parentPath Location to create the directory [in] _warningOp Allow or suppress filesystem warnings
- Returns
- Path to newly-created temporary directory
◆ cwd()
std::string cwd | ( | ) |
Get the current working directory.
- Returns
- Name of the current directory
◆ DelaunayTriangulation()
bool GZ_COMMON_GRAPHICS_VISIBLE DelaunayTriangulation | ( | const std::vector< gz::math::Vector2d > & | _vertices, |
const std::vector< gz::math::Vector2i > & | _edges, | ||
SubMesh * | _submesh | ||
) |
Perform delaunay triangulation on input vertices.
- Parameters
-
[in] _vertices A list of all vertices [in] _edges A list of edges. Each edge is made of 2 vertex indices from _vertices [out] _submesh A submesh that will be populated with the resulting triangles.
- Returns
- True on success.
◆ EndsWith()
bool EndsWith | ( | const std::string & | _s1, |
const std::string & | _s2 | ||
) |
return true if string ends with another string
- Parameters
-
[in] _s1 the string to check [in] _s2 the possible suffix
- Returns
- true if _s1 ends with _s2
◆ env() [1/2]
bool env | ( | const std::string & | _name, |
std::string & | _value | ||
) |
Find the environment variable '_name' and return its value.
\TODO(mjcarroll): Deprecate and remove in tick-tock.
- Parameters
-
[in] _name Name of the environment variable. [out] _value Value if the variable was found.
- Returns
- True if the variable was found or false otherwise.
◆ env() [2/2]
bool env | ( | const std::string & | _name, |
std::string & | _value, | ||
bool | _allowEmpty | ||
) |
Find the environment variable '_name' and return its value.
- Parameters
-
[in] _name Name of the environment variable. [out] _value Value if the variable was found. [in] _allowEmpty Allow set-but-empty variables. (Unsupported on Windows)
- Returns
- True if the variable was found or false otherwise.
◆ exists()
bool exists | ( | const std::string & | _path | ) |
Determine whether the given path exists on the filesystem.
- Parameters
-
[in] _path The path to check for existence
- Returns
- True if the path exists on the filesystem, false otherwise.
◆ ExtractCSVToken()
GZ_COMMON_IO_VISIBLE std::istream & ExtractCSVToken | ( | std::istream & | _stream, |
CSVToken & | _token, | ||
const CSVDialect & | _dialect = CSVDialect::Unix |
||
) |
Extract a single token from an input stream of CSV data.
If tokenization fails, the CSV data stream failbit
will be set.
- Parameters
-
[in] _stream A stream of CSV data to tokenize. [out] _token Output CSV token to extract into. [in] _dialect CSV data dialect. Defaults to the Unix dialect.
- Returns
- same CSV data stream.
◆ findFile() [1/2]
std::string findFile | ( | const std::string & | _file | ) |
search for file in common::SystemPaths
- Parameters
-
[in] _file Name of the file to find.
- Returns
- The path containing the file.
◆ findFile() [2/2]
std::string findFile | ( | const std::string & | _file, |
bool | _searchLocalPath | ||
) |
search for file in common::SystemPaths
- Parameters
-
[in] _file Name of the file to find. [in] _searchLocalPath True to search in the current working directory.
- Returns
- The path containing the file.
◆ findFilePath()
std::string findFilePath | ( | const std::string & | _file | ) |
search for a file in common::SystemPaths
- Parameters
-
[in] _file the file name to look for.
- Returns
- The path containing the file.
◆ hash64()
|
constexpr |
fnv1a algorithm for 64-bit platforms.
- Parameters
-
[in] _key The input string.
- Returns
- A 64-bit unsigned hash value. https://notes.underscorediscovery.com/constexpr-fnv1a/
◆ isDirectory()
bool isDirectory | ( | const std::string & | _path | ) |
Determine whether the given path is a directory.
- Parameters
-
[in] _path The path to check
- Returns
- True if given path exists and is a directory, false otherwise.
◆ isFile()
bool isFile | ( | const std::string & | _path | ) |
Check if the given path is a file.
- Parameters
-
[in] _path Path to a file.
- Returns
- True if _path is a file.
◆ isRelativePath()
bool isRelativePath | ( | const std::string & | _path | ) |
Check if the given path is relative.
- Parameters
-
[in] _path Path.
- Returns
- True if _path is relative.
◆ Join() [1/2]
std::string Join | ( | const std::vector< std::string > & | _orig, |
char | _delim | ||
) |
Join a sequence of strings with a delimiter.
Note that this will skip any empty entries in the vector, and will also not prepend or append the delimiter to the final output string
- Parameters
-
[in] _orig The input sequence of strings [in] _delim a character to join the string with
- Returns
- a single string composed of strings joined with the delimiter
◆ Join() [2/2]
std::string Join | ( | const std::vector< std::string > & | _orig, |
const std::string & | _delim | ||
) |
Join a sequence of strings with a delimiter.
Note that this will skip any empty entries in the vector, and will also not prepend or append the delimiter to the final output string
- Parameters
-
[in] _orig The input sequence of strings [in] _delim a string delimiter to join the string with
- Returns
- a single string composed of strings joined with the delimiter
◆ joinPaths() [1/3]
|
inline |
base case for joinPaths(...) below
◆ joinPaths() [2/3]
std::string joinPaths | ( | const std::string & | _path1, |
const std::string & | _path2 | ||
) |
Join two strings together to form a path.
- Parameters
-
[in] _path1 the left portion of the path [in] _path2 the right portion of the path
- Returns
- Joined path. The function can do simplifications such as elimination of ../ and removal of duplicate // (but is not guaranteed to do so).
Referenced by joinPaths().
◆ joinPaths() [3/3]
|
inline |
Append one or more additional path elements to the first passed in argument.
- Parameters
-
[in] args The paths to append together
- Returns
- A new string with the paths appended together.
References joinPaths().
◆ load()
void load | ( | ) |
Load external libraries, such as libav. It is safe to call this multiple times.
◆ logPath()
std::string logPath | ( | ) |
Get the log path.
- Returns
- the log path
◆ lowercase() [1/2]
std::string lowercase | ( | const char * | _in | ) |
Transforms a string to its lowercase equivalent.
- Parameters
-
[in] _in String to convert to lowercase
- Returns
- Lowercase equilvalent of _in.
◆ lowercase() [2/2]
std::string lowercase | ( | const std::string & | _in | ) |
Transforms a string to its lowercase equivalent.
- Parameters
-
[in] _in String to convert to lowercase
- Returns
- Lowercase equilvalent of _in.
◆ ltrim()
void ltrim | ( | std::string & | _s | ) |
In place left trim.
- Parameters
-
[in,out] _s String to trim
◆ ltrimmed()
std::string ltrimmed | ( | std::string | _s | ) |
Copying left trim.
- Parameters
-
[in] _s String to trim
- Returns
- Trimmed string
◆ moveFile()
bool moveFile | ( | const std::string & | _existingFilename, |
const std::string & | _newFilename, | ||
const FilesystemWarningOp | _warningOp = FSWO_LOG_WARNINGS |
||
) |
Move a file.
- Parameters
-
[in] _existingFilename Full path to an existing file. [in] _newFilename Full path of the new file. [in] _warningOp Log or suppress warnings that may occur.
- Returns
- True on success.
◆ operator==()
bool GZ_COMMON_IO_VISIBLE operator== | ( | const CSVDialect & | _lhs, |
const CSVDialect & | _rhs | ||
) |
Check CSV dialects for equality.
- Parameters
-
[in] _lhs Left-hand side CSV dialect. [in] _rhs Right-hand side CSV dialect.
- Returns
- true if CSV dialects are equal, false otherwise.
◆ parentPath()
std::string parentPath | ( | const std::string & | _path | ) |
Given a path, get just its parent path portion, without separator at the end.
- Parameters
-
[in] _path Path of which to find parent path
- Returns
- A new string with just the parent path of the path.
◆ ParseCSVRow()
GZ_COMMON_IO_VISIBLE std::istream & ParseCSVRow | ( | std::istream & | _stream, |
std::vector< std::string > & | _row, | ||
const CSVDialect & | _dialect = CSVDialect::Unix |
||
) |
Parse a single row from an input stream of CSV data.
If parsing fails, the CSV data stream failbit
will be set.
- Parameters
-
[in] _stream CSV data stream to parse. [out] _row Output CSV row to parse into. [in] _dialect CSV data dialect. Defaults to the Unix dialect.
- Returns
- same CSV data stream.
◆ PluralCast() [1/2]
std::string PluralCast | ( | const std::string & | _baseWord, |
const int | _n | ||
) |
Choose whether to use a singular or plural version of a noun based on the value of an integer quantity. This version will simply add an 's' character to _baseWord in the event that std::abs(_n) != 1, otherwise it returns _baseWord.
- Parameters
-
[in] _baseWord the singular version of the word to return [in] _n the quantity that _baseWord is describing
- Returns
- _baseWord if std::abs(_n)==1, otherwise return _baseWords
◆ PluralCast() [2/2]
std::string PluralCast | ( | const std::string & | _singular, |
const std::string & | _plural, | ||
const int | _n | ||
) |
A version of PluralCast that works for irregular nouns. If std::abs(_n)==1 then _singular is returned; otherwise _plural will be returned.
- Parameters
-
[in] _singular the return value when std::abs(_n) == 1 [in] _plural the return value when std::abs(_n) != 1
- Returns
- _singular if std::abs(_n)==1, otherwise return _plural
◆ removeAll()
bool removeAll | ( | const std::string & | _path, |
const FilesystemWarningOp | _warningOp = FSWO_LOG_WARNINGS |
||
) |
Remove a file or a directory and all its contents.
- Parameters
-
[in] _path Path to a directory or file. [in] _warningOp Log or suppress warnings that may occur.
- Returns
- True if _path was removed.
◆ removeDirectory()
bool removeDirectory | ( | const std::string & | _path, |
const FilesystemWarningOp | _warningOp = FSWO_LOG_WARNINGS |
||
) |
Remove an empty directory.
- Remarks
- the directory must be empty to be removed
- Parameters
-
[in] _path Path to a directory. [in] _warningOp Log or suppress warnings that may occur.
- Returns
- True if _path is a directory and was removed.
◆ removeDirectoryOrFile()
bool removeDirectoryOrFile | ( | const std::string & | _path, |
const FilesystemWarningOp | _warningOp = FSWO_LOG_WARNINGS |
||
) |
Remove an empty directory or file.
- Parameters
-
[in] _path Path to a directory or file. [in] _warningOp Log or suppress warnings that may occur.
- Returns
- True if _path was removed.
◆ removeFile()
bool removeFile | ( | const std::string & | _existingFilename, |
const FilesystemWarningOp | _warningOp = FSWO_LOG_WARNINGS |
||
) |
Remove a file.
- Parameters
-
[in] _existingFilename Full path to an existing file. [in] _warningOp Log or suppress warnings that may occur.
- Returns
- True on success.
◆ replaceAll() [1/2]
std::string replaceAll | ( | const std::string & | _orig, |
const std::string & | _key, | ||
const std::string & | _replacement | ||
) |
Replace all occurances of _key with _replacement.
- Parameters
-
[in] _orig Original string. [in] _key String to replace. [in] _replacement The string that replaces _key.
- Returns
- The new string that has had _key replaced with _replacement.
◆ replaceAll() [2/2]
void replaceAll | ( | std::string & | _result, |
const std::string & | _orig, | ||
const std::string & | _key, | ||
const std::string & | _replacement | ||
) |
Replace all occurances of _key with _replacement.
- Parameters
-
[out] _result The new string that has had _key replaced with _replacement. [in] _orig Original string. [in] _key String to replace. [in] _replacement The string that replaces _key.
◆ rtrim()
void rtrim | ( | std::string & | _s | ) |
In place right trim.
- Parameters
-
[in,out] _s String to trim
◆ rtrimmed()
std::string rtrimmed | ( | std::string | _s | ) |
Copying right trim.
- Parameters
-
[in] _s String to trim
- Returns
- Trimmed string
◆ separator()
std::string const separator | ( | std::string const & | _s | ) |
Append the preferred path separator character for this platform onto the passed-in string.
- Parameters
-
[in] _s The path to start with.
- Returns
- The original path with the platform path separator appended.
◆ setenv()
bool setenv | ( | const std::string & | _name, |
const std::string & | _value | ||
) |
Set the environment variable '_name'.
Note that on Windows setting an empty string (_value=="") is the equivalent of unsetting the variable.
- Parameters
-
[in] _name Name of the environment variable. [in] _value Value of the variable to be set.
- Returns
- True if the variable was set or false otherwise.
◆ sha1() [1/2]
std::string sha1 | ( | const T & | _buffer | ) |
Compute the SHA1 hash of an array of bytes.
- Parameters
-
[in] _buffer Input sequence. The permitted data types for this function are std::string and any STL container.
- Returns
- The string representation (40 character) of the SHA1 hash.
◆ sha1() [2/2]
std::string sha1 | ( | void const * | _buffer, |
std::size_t | _byteCount | ||
) |
Compute the SHA1 hash of an array of bytes. Use std::string sha1(const T &_buffer) instead of this function.
- Parameters
-
[in] _buffer Input sequence. The permitted data types for this function are std::string and any STL container.
- Returns
- The string representation (40 character) of the SHA1 hash.
- See also
- sha1(const T &_buffer)
◆ Split()
std::vector< std::string > Split | ( | const std::string & | _orig, |
char | _delim | ||
) |
split at a one character delimiter to get a vector of something
- Parameters
-
[in] _orig The string to split [in] _delim a character to split the string at
- Returns
- vector of split pieces of the string excluding the delimiter
◆ split()
std::vector< std::string > split | ( | const std::string & | _str, |
const std::string & | _delim | ||
) |
Splits a string into tokens.
- Parameters
-
[in] _str Input string. [in] _delim Token delimiter.
- Returns
- Vector of tokens.
◆ StartsWith()
bool StartsWith | ( | const std::string & | _s1, |
const std::string & | _s2 | ||
) |
return true if string starts with another string
- Parameters
-
[in] _s1 the string to check [in] _s2 the possible prefix
- Returns
- true if _s1 starts with _s2
◆ systemPaths()
common::SystemPaths * systemPaths | ( | ) |
Get a pointer to the global system paths that is used by all the findFile functions. The returned instance has global shared state for a given process. Care should be taken when manipulating global system paths Caller should not assume ownership of the pointer.
- Returns
- A mutable reference to the system paths object.
◆ systemTimeISO()
std::string systemTimeISO | ( | ) |
Please use systemTimeIso() as this function will be deprecated in Gazebo Common 4. Get the wall time as an ISO string: YYYY-MM-DDTHH:MM:SS.NS.
- Returns
- The current wall time as an ISO string.
- See also
- systemTimeIso();
◆ systemTimeIso()
std::string systemTimeIso | ( | ) |
Get the wall time as an ISO string: YYYY-MM-DDTHH:MM:SS.NS.
- Returns
- The current wall time as an ISO string.
◆ tempDirectoryPath()
std::string tempDirectoryPath | ( | ) |
Return the path to a directory suitable for temporary files.
Calls std::filesystem::temp_directory_path, refer to the standard documentation for your platform for behaviors.
- Returns
- A directory suitable for temporary files.
◆ timeToIso()
std::string timeToIso | ( | const std::chrono::time_point< std::chrono::system_clock > & | _time | ) |
Converts a time point to an ISO string: YYYY-MM-DDTHH:MM:SS.NS.
- Parameters
-
[in] _time A time point, such as one created by GZ_SYSTEM_TIME().
- Returns
- An ISO string that represents the given _time.
◆ trim()
void trim | ( | std::string & | _s | ) |
In place trim from both ends.
- Parameters
-
[in,out] _s String to trim
◆ trimmed()
std::string trimmed | ( | std::string | _s | ) |
Copying trim from both ends.
- Parameters
-
[in] _s String to trim
- Returns
- Trimmed string
◆ uniqueDirectoryPath()
std::string uniqueDirectoryPath | ( | const std::string & | _dir | ) |
Unique directory path to not overwrite existing directory.
- Parameters
-
[in] _pathAndName Full absolute path
- Returns
- Full path which doesn't collide with existing files
◆ uniqueFilePath()
std::string uniqueFilePath | ( | const std::string & | _pathAndName, |
const std::string & | _extension | ||
) |
Generates a path for a file which doesn't collide with existing files, by appending numbers to it (i.e. (0), (1), ...)
- Parameters
-
[in] _pathAndName Full absolute path and file name up to the file extension. [in] _extension File extension, such as "sdf".
- Returns
- Full path with name and extension, which doesn't collide with existing files
◆ unsetenv()
bool unsetenv | ( | const std::string & | _name | ) |
Unset the environment variable '_name'.
- Parameters
-
[in] _name Name of the environment variable.
- Returns
- True if the variable was unset or false otherwise.
◆ uuid()
std::string uuid | ( | ) |
Get a UUID.
- Returns
- A UUID string
Variable Documentation
◆ PixelFormatNames
|
static |
String names for the pixel formats.
- See also
- Image::PixelFormat.