# _stringf.h File Reference

`#include <string>`
`#include <cstdarg>`
`#include <cstdlib>`
`#include <cstdio>`
`#include <unistd.h>`

Go to the source code of this file.

## Defines

#define | ETL_STRPRINTF_MAX_LENGTH (800)
#define | POPEN_BINARY_READ_TYPE "r"
#define | POPEN_BINARY_WRITE_TYPE "w"
#define | ETL_NO_THROW throw()
#define | ETL_NO_VSTRSCANF
#define | ETL_UNSAFE_STRPRINTF (true)
#define | stratof(X) (atof((X).c_str()))
#define | stratoi(X) (atoi((X).c_str()))

## Functions

_ETL_END_CDECLS _ETL_BEGIN_NAMESPACE std::string | vstrprintf (const char *format, va_list args)
std::string | strprintf (const char *format,...)
std::string | basename (const std::string &str)
std::string | dirname (const std::string &str)
std::string | filename_extension (const std::string &str)
std::string | filename_sans_extension (const std::string &str)
bool | is_absolute_path (const std::string &path)
std::string | unix_to_local_path (const std::string &path)
std::string | current_working_directory ()
std::string | get_root_from_path (std::string path)
std::string | remove_root_from_path (std::string path)
std::string | cleanup_path (std::string path)
std::string | absolute_path (std::string path)
std::string | relative_path (std::string curr_path, std::string dest_path)

## Define Documentation

#define ETL_STRPRINTF_MAX_LENGTH (800)

Definition at line 45 of file _stringf.h.

Referenced by vstrprintf().

#define POPEN_BINARY_READ_TYPE "r"

Definition at line 52 of file _stringf.h.

#define POPEN_BINARY_WRITE_TYPE "w"

Definition at line 53 of file _stringf.h.

#define ETL_NO_THROW throw()

Definition at line 63 of file _stringf.h.

#define ETL_NO_VSTRSCANF

Definition at line 88 of file _stringf.h.

#define ETL_UNSAFE_STRPRINTF (true)

#define stratof | ( | X |  | ) | (atof((X).c_str()))

Definition at line 173 of file _stringf.h.

#define stratoi | ( | X |  | ) | (atoi((X).c_str()))

Definition at line 174 of file _stringf.h.

## Function Documentation

_ETL_END_CDECLS _ETL_BEGIN_NAMESPACE std::string vstrprintf | ( | const char * | format,
|  | va_list | args |
| ) |  |  | `[inline]`

Definition at line 105 of file _stringf.h.

References ETL_STRPRINTF_MAX_LENGTH.

Referenced by strprintf().

std::string strprintf | ( | const char * | format,
|  |  | ... |
| ) |  |  | `[inline]`

Definition at line 144 of file _stringf.h.

References vstrprintf().

std::string basename | ( | const std::string & | str | ) | `[inline]`

Definition at line 177 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR.

Referenced by cleanup_path(), filename_extension(), filename_sans_extension(), and relative_path().

std::string dirname | ( | const std::string & | str | ) | `[inline]`

Definition at line 203 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR.

Referenced by cleanup_path(), filename_sans_extension(), and relative_path().

std::string filename_extension | ( | const std::string & | str | ) | `[inline]`

Definition at line 232 of file _stringf.h.

References basename().

std::string filename_sans_extension | ( | const std::string & | str | ) | `[inline]`

Definition at line 242 of file _stringf.h.

References basename(), dirname(), and ETL_DIRECTORY_SEPARATOR.

bool is_absolute_path | ( | const std::string & | path | ) | `[inline]`

Definition at line 253 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR.

Referenced by absolute_path(), and relative_path().

std::string unix_to_local_path | ( | const std::string & | path | ) | `[inline]`

Definition at line 265 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR.

std::string current_working_directory | ( |  | ) | `[inline]`

Definition at line 286 of file _stringf.h.

Referenced by absolute_path().

std::string get_root_from_path | ( | std::string | path | ) | `[inline]`

Definition at line 294 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR.

Referenced by cleanup_path(), and relative_path().

std::string remove_root_from_path | ( | std::string | path | ) | `[inline]`

Definition at line 311 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR.

Referenced by cleanup_path(), and relative_path().

std::string cleanup_path | ( | std::string | path | ) | `[inline]`

Definition at line 326 of file _stringf.h.

References basename(), dirname(), ETL_DIRECTORY_SEPARATOR, get_root_from_path(), and remove_root_from_path().

Referenced by absolute_path(), and relative_path().

std::string absolute_path | ( | std::string | path | ) | `[inline]`

Definition at line 354 of file _stringf.h.

References cleanup_path(), current_working_directory(), ETL_DIRECTORY_SEPARATOR, and is_absolute_path().

Referenced by relative_path().

std::string relative_path | ( | std::string | curr_path,
|  | std::string | dest_path |
| ) |  |  | `[inline]`

Definition at line 366 of file _stringf.h.

References absolute_path(), basename(), cleanup_path(), dirname(), ETL_DIRECTORY_SEPARATOR, get_root_from_path(), is_absolute_path(), and remove_root_from_path().