- english
- /
- japanese
functions
- ofBinaryToChar()
- ofBinaryToFloat()
- ofBinaryToInt()
- ofBinaryToString()
- ofContains()
- ofFind()
- ofGetDay()
- ofGetElapsedTimeMicros()
- ofGetElapsedTimeMillis()
- ofGetElapsedTimef()
- ofGetFrameNum()
- ofGetHours()
- ofGetMinutes()
- ofGetMonth()
- ofGetSeconds()
- ofGetSystemTimeMicros()
- ofGetTargetPlatform()
- ofGetTimestampString()
- ofGetUnixTime()
- ofGetVersionInfo()
- ofGetWeekday()
- ofGetYear()
- ofHexToChar()
- ofHexToFloat()
- ofHexToInt()
- ofHexToString()
- ofIsStringInString()
- ofJoinString()
- ofLaunchBrowser()
- ofNextPow2()
- ofRandomize()
- ofRemove()
- ofResetElapsedTimeCounter()
- ofSaveFrame()
- ofSaveScreen()
- ofSaveViewport()
- ofSetDataPathRoot()
- ofSort()
- ofSplitString()
- ofStringReplace()
- ofSystem()
- ofToBinary()
- ofToBool()
- ofToChar()
- ofToFloat()
- ofToHex()
- ofToInt()
- ofToLower()
- ofToString()
- ofToUpper()
- ofVAArgsToString()
ofBinaryToChar(...)
char ofBinaryToChar(const string &value)
Interprets a string consisting only of 1s and 0s as a char, and returns the corresponding char value.
ofBinaryToFloat(...)
float ofBinaryToFloat(const string &value)
Interprets a string consisting only of 1s and 0s as a float (little-endian, 32-bit IEEE 754), and returns the corresponding float value.
ofBinaryToInt(...)
int ofBinaryToInt(const string &value)
Interprets a string consisting only of 1s and 0s as an int (little-endian, 32-bit), and returns the corresponding int value.
ofBinaryToString(...)
string ofBinaryToString(const string &value)
Interprets a string consisting only of 1s and 0s as 8-bit ASCII characters, and returns the corresponding string.
ofHexToChar(...)
char ofHexToChar(const string &charHexString)
Converts a hexadecimal representation of an char (e.g., "61") to an actual char (e.g., a).
ofHexToFloat(...)
float ofHexToFloat(const string &floatHexString)
Converts a hexadecimal representation of an float (little-endian, 32-bit IEEE 754, e.g., "4060000000000000") to an actual float (e.g., 128.f).
ofHexToInt(...)
int ofHexToInt(const string &intHexString)
Converts a hexadecimal representation of an int (little-endian, 32-bit, e.g., "0xbadf00d" or "badf00d") to an actual int.
ofHexToString(...)
string ofHexToString(const string &stringHexString)
Converts a hexadecimal representation of an string (e.g., "61626364656667") to an actual string ("abcdefg");
ofIsStringInString(...)
bool ofIsStringInString(string haystack, string needle)
Checks if the string needle exists in the string haystack.
ofJoinString(...)
string ofJoinString(vector< string > stringElements, const string &delimiter)
Turns a stringElements into a single string, with an instance of delimiter between all the elements.
ofLaunchBrowser(...)
void ofLaunchBrowser(string url)
Opens your computer's default browser and loads the specified url.
ofSaveScreen(...)
void ofSaveScreen(string filename)
Saves the current screen image into a given file name (string filename). Example:
string filename;
fileName = "screen1.png";
ofSaveScreen(fileName);
ofSplitString(...)
vector
This function is used to delete some parts of a given string (str). We set in delimiter the parts we want to delete. For example if we call ofSplitSpring in my setup function:
result=ofSplitString("of rocks", "of");
we obtain: result[0]=r result[1]=cks this is the result of deleting o and f letters in the string.
We can find a very useful application if we use delimiter = " ":
result=ofSplitString("of rocks", " ");
we obtain: result[0]=of result[1]=rocks Like this we can "cut" a big string and turn it into a vector of words.
ofSplitString(...)
vector< string > ofSplitString(const string &source, const string &delimiter, bool ignoreEmpty=false, bool trim=false)
Splits source using delimiter and returns the separate tokens. In modern versions of openFrameworks, delimiter can be a multi-character string. In older versions of openFrameworks, delimiter was interpreted as multiple single-character delimiters.
ofStringReplace(...)
void ofStringReplace(string &input, string searchStr, string replaceStr)
Searches input for instances of searchStr and replaces them with replaceStr.
ofToBinary(...)
string ofToBinary(const T &value)
Converts any datatype value to a string of only 1s and 0s corresponding to the way value is stored in memory.
ofToBinary(...)
string ofToBinary(const string &value)
Converts a string value to a string of only 1s and 0s corresponding to the way value is stored in memory.
ofToBinary(...)
string ofToBinary(const char *value)
Converts any C-style string value to a string of only 1s and 0s corresponding to the way value is stored in memory.
ofToBool(...)
bool ofToBool(const string &boolString)
Converts a string representation boolString (e.g., "TRUE") to an actual bool using a case-insensitive comparison against the words "true" and "false".
ofToChar(...)
char ofToChar(const string &charString)
Converts a string representation of a single char (e.g., " c ") to an actual char.
ofToFloat(...)
void ofToFloat(const string& floatString)
Converts the string "floatString" into a float value.
ofToFloat(...)
float ofToFloat(const string &floatString)
Converts a string representation floatString (e.g., "3.14") to an actual float.
ofToHex(...)
string ofToHex(const T &value)
Converts any value to its equivalent hexadecimal representation corresponding to the way it is stored in memory.
ofToHex(...)
string ofToHex(const string &value)
Converts a string (e.g., "abc") to its equivalent hexadecimal representation (e.g., "616263").
ofToHex(...)
string ofToHex(const char *value)
Converts a c-style string (e.g., "abc") to its equivalent hexadecimal representation (e.g., "616263").
ofToInt(...)
int ofToInt(const string& intString)
Converts the string "intString" into an integer value.
ofToInt(...)
int ofToInt(const string &intString)
Converts a string representation of an int (e.g., "2012") to an actual int.
ofToLower(...)
string ofToLower(const string &src)
Converts all characters in the string src to lowercase.
ofToString(...)
string ofToString(int value)
To make adding numbers to a string easy we have the ofToString object which takes a number and turns it into a string representation of that number. For floating point numbers 'precision' is the number of decimal places you want to use. There is a default value for 'precision' of 7 decimal places, so if you don't wish to specify it you can just pass the first argument.
This example makes a custom string to show the framerate in the window title.
string str = "framerate is ";
str += ofToString(ofGetFrameRate(), 2)+"fps";
ofSetWindowTitle(str);
//set the window title to "framerate is 45.30fps"
ofToString(...)
string ofToString(const vector< T > &values)
Converts a vector of values to a single string representation.
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
vec.push_back(3);
cout << ofToString(vec) << endl; // prints "{1, 2, 3}"
ofToUpper(...)
string ofToUpper(const string &src)
Converts all characters in the string src to uppercase.
Last updated
Thursday, 16 May 2013 14:01:39 UTC
-
cbf0910627a25e6153f2452833c5313fe6067059

