ETL  0.04.19
Macros | Functions
_stringf.h File Reference
#include <string>
#include <cstdarg>
#include <cstdlib>
#include <cstdio>
#include <unistd.h>

Go to the source code of this file.

Macros

#define _GNU_SOURCE
#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 strscanf(data, format,...)   sscanf(data.c_str(),format,__VA_ARGS__)
#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,...)
bool is_separator (char c)
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)

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 34 of file _stringf.h.

#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 strscanf (   data,
  format,
  ... 
)    sscanf(data.c_str(),format,__VA_ARGS__)

Definition at line 168 of file _stringf.h.

#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().

bool is_separator ( char  c)
inline
std::string basename ( const std::string &  str)
inline

Definition at line 182 of file _stringf.h.

References is_separator().

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

std::string dirname ( const std::string &  str)
inline

Definition at line 208 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR, and is_separator().

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

std::string filename_extension ( const std::string &  str)
inline

Definition at line 237 of file _stringf.h.

References basename().

std::string filename_sans_extension ( const std::string &  str)
inline

Definition at line 247 of file _stringf.h.

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

bool is_absolute_path ( const std::string &  path)
inline

Definition at line 258 of file _stringf.h.

References is_separator().

Referenced by absolute_path(), and relative_path().

std::string unix_to_local_path ( const std::string &  path)
inline

Definition at line 270 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR, and is_separator().

std::string current_working_directory ( )
inline

Definition at line 291 of file _stringf.h.

Referenced by absolute_path().

std::string get_root_from_path ( std::string  path)
inline

Definition at line 299 of file _stringf.h.

References ETL_DIRECTORY_SEPARATOR, and is_separator().

Referenced by cleanup_path(), and relative_path().

std::string remove_root_from_path ( std::string  path)
inline

Definition at line 316 of file _stringf.h.

References is_separator().

Referenced by cleanup_path(), and relative_path().

std::string cleanup_path ( std::string  path)
inline
std::string absolute_path ( std::string  path)
inline
std::string relative_path ( std::string  curr_path,
std::string  dest_path 
)
inline