33 #include <boost/lexical_cast.hpp>
63 std::vector<std::string>
split(
const std::string &str,
char separator,
bool compress =
true );
71 void sleep(
float milliseconds );
74 #if (defined( CINDER_MSW ) || defined( CINDER_WINRT ))
87 #if defined(CINDER_COCOA_TOUCH)
106 extern void swapEndianBlock( uint16_t *blockPtr,
size_t blockSizeInBytes );
107 extern void swapEndianBlock(
float *blockPtr,
size_t blockSizeInBytes );
fs::path getTemporaryDirectory()
Returns a path to the user's temporary directory.
Definition: Utilities.cpp:123
std::string getPathFileName(const std::string &path)
Returns the file name portion of file path path. For example "C:\Images\Beyonce.jpg" returns "Beyonce...
Definition: Utilities.cpp:183
int8_t swapEndian(int8_t val)
Definition: Utilities.h:97
GLsizei const GLchar ** string
Definition: GLee.h:2427
fs::path getTemporaryFilePath(const std::string &prefix="")
Returns a path that is gauranteed to be unique and is suitable for creating a temporary file...
Definition: Utilities.cpp:146
std::vector< std::string > 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.
Definition: Utilities.cpp:261
void deleteFile(const fs::path &path)
Delete the file at path. Fails quietly if the path does not exist.
Definition: Utilities.cpp:248
fs::path expandPath(const fs::path &path)
Returns a canonical version of path by expanding a "~" and symlinks on the Mac "..", "." and "//".
Definition: Utilities.cpp:70
void sleep(float milliseconds)
Suspends the execution of the current thread until milliseconds have passed. Supports sub-millisecond...
Definition: Utilities.cpp:286
std::string toString(const T &t)
Definition: Utilities.h:81
fs::path getHomeDirectory()
Returns a path to the user's home directory.
Definition: Utilities.cpp:86
std::string loadString(DataSourceRef dataSource)
Loads the contents of dataSource and returns it as a std::string.
Definition: Utilities.cpp:276
char getPathSeparator()
Returns the path separator for the host operating system's file system, '\' on Windows and '/' on Mac...
Definition: Utilities.h:77
GLuint GLfloat * val
Definition: GLee.h:14636
std::vector< std::string > stackTrace()
Returns a stack trace (aka backtrace) where stackTrace()[0] == caller, stackTrace()[1] == caller's pa...
Definition: Utilities.cpp:340
void swapEndianBlock(uint16_t *blockPtr, size_t blockSizeInBytes)
Definition: Utilities.cpp:429
void launchWebBrowser(const Url &url)
Launches a path in a web browser.
Definition: Utilities.cpp:222
std::string 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...
Definition: Utilities.cpp:173
GLdouble GLdouble t
Definition: GLee.h:1426
std::shared_ptr< class DataSource > DataSourceRef
Definition: DataSource.h:35
GLdouble s
Definition: GLee.h:1378
T fromString(const std::string &s)
Definition: Utilities.h:83
bool createDirectories(const fs::path &path, bool createParents=true)
Creates a directory at path and optionally creates any missing parent directories when createParents ...
Definition: Utilities.cpp:205
fs::path getDocumentsDirectory()
Returns a path to the user's documents directory.
Definition: Utilities.cpp:106
std::string getPathExtension(const std::string &path)
Returns the file extension of the file located at path.
Definition: Utilities.cpp:192