Namespaces | Functions
src/cinder/Utilities.cpp File Reference

Namespaces

namespace  cinder

Functions

fs::path cinder::expandPath (const fs::path &path)
 Returns a canonical version of path by expanding a "~" and symlinks on the Mac "..", "." and "//".
fs::path cinder::getHomeDirectory ()
 Returns a path to the user's home directory.
fs::path cinder::getDocumentsDirectory ()
 Returns a path to the user's documents directory.
fs::path cinder::getTemporaryDirectory ()
 Returns a path to the user's temporary directory.
fs::path cinder::getTemporaryFilePath (const std::string &prefix="")
 Returns a path that is gauranteed to be unique and is suitable for creating a temporary file. An optional prefix parameters allows specification of a file name prefix, some portion of which will be incorporated into the result. Note a race condition that can exist between the uniqueness of the path and the creation of the file.
std::string cinder::getPathDirectory (const std::string &path)
 Returns the directory portion of file path path, the last component of which must be a file name or a terminating path separator.
std::string cinder::getPathFileName (const std::string &path)
 Returns the file name portion of file path path. For example "C:\Images\Beyonce.jpg" returns "Beyonce.jpg".
std::string cinder::getPathExtension (const std::string &path)
 Returns the file extension of the file located at path.
bool cinder::createDirectories (const fs::path &path, bool createParents=true)
 Creates a directory at path and optionally creates any missing parent directories when createParents is true. Returns true upon success.
void cinder::launchWebBrowser (const Url &url)
 Launches a path in a web browser.
void cinder::deleteFile (const fs::path &path)
 Delete the file at path. Fails quietly if the path does not exist.
std::vector< std::string > cinder::split (const std::string &str, char separator, bool compress=true)
 Returns a vector of substrings split by the separator separator. split( "one two three", ' ' ) -> [ "one", "two", "three" ] If compress is TRUE, it will consider consecutive separators as one.
std::vector< std::string > cinder::split (const std::string &str, const std::string &separators, bool compress=true)
 Returns a vector of substrings split by the characters in separators. split( "one, two, three", " ," ) -> [ "one", "two", "three" ] If compress is TRUE, it will consider consecutive separators as one.
std::string cinder::loadString (DataSourceRef dataSource)
 Loads the contents of dataSource and returns it as a std::string.
std::wstring cinder::toUtf16 (const std::string &utf8)
 Returns a utf-16 encoded std::wstring by converting the utf-8 encoded string utf8.
std::string cinder::toUtf8 (const std::wstring &utf16)
 Returns a utf-8 encoded std::string by converting the utf-16 encoded string utf16.
void cinder::sleep (float milliseconds)
 Suspends the execution of the current thread until milliseconds have passed. Supports sub-millisecond precision only on Mac OS X.
std::vector< std::string > cinder::stackTrace ()
 Returns a stack trace (aka backtrace) where stackTrace()[0] == caller, stackTrace()[1] == caller's parent, etc.
int16_t cinder::swapEndian (int16_t val)
uint16_t cinder::swapEndian (uint16_t val)
int32_t cinder::swapEndian (int32_t val)
uint32_t cinder::swapEndian (uint32_t val)
float cinder::swapEndian (float val)
double cinder::swapEndian (double val)
void cinder::swapEndianBlock (uint16_t *blockPtr, size_t blockSizeInBytes)
void cinder::swapEndianBlock (float *blockPtr, size_t blockSizeInBytes)