CUGL
Cornell University Game Library
|
Typedefs | |
typedef std::function< void(const std::string &name, bool down)> | ButtonListener |
typedef std::function< void(const std::string &key, bool success)> | LoaderCallback |
typedef std::function< void(const AccelerationEvent &event, bool focus)> | AccelerationListener |
typedef std::function< void(const KeyEvent &event, bool focus)> | KeyListener |
typedef std::function< void(const MouseEvent &event, Uint8 clicks, bool focus)> | MouseButtonListener |
typedef std::function< void(const MouseEvent &event, const Vec2 &previous, bool focus)> | MouseMotionListener |
typedef std::function< void(const MouseWheelEvent &event, bool focus)> | MouseWheelListener |
typedef std::function< void(const TextInputEvent &event, bool focus)> | TextInputListener |
typedef std::function< bool(const std::string &value)> | TextInputValidator |
typedef Sint64 | TouchID |
typedef std::function< void(const TouchEvent &event, bool focus)> | TouchListener |
typedef std::function< void(const TouchEvent &event, const Vec2 &previous, bool focus)> | TouchMotionListener |
typedef std::function< void(const GestureEvent &event, bool focus)> | GestureListener |
typedef std::function< void(GestureState ostate, GestureState nstate)> | GestureStateListener |
typedef std::function< void(const PanEvent &event, bool focus)> | PanListener |
typedef std::function< void(const PinchEvent &event, bool focus)> | PinchListener |
typedef std::function< void(const RotationEvent &event, bool focus)> | RotationListener |
typedef Vec2 | Point2 |
typedef Vec3 | Point3 |
Functions | |
int | operator* (Font::Style value) |
Font::Style | operator| (Font::Style lhs, Font::Style rhs) |
Font::Style | operator& (Font::Style lhs, Font::Style rhs) |
Font::Style | operator^ (Font::Style lhs, Font::Style rhs) |
Font::Style | operator~ (Font::Style lhs) |
SDL_FORCE_INLINE Uint16 | marshall (Sint16 value) |
SDL_FORCE_INLINE Uint16 | marshall (Uint16 value) |
SDL_FORCE_INLINE Uint32 | marshall (Sint32 value) |
SDL_FORCE_INLINE Uint32 | marshall (Uint32 value) |
SDL_FORCE_INLINE Uint64 | marshall (Sint64 value) |
SDL_FORCE_INLINE Uint64 | marshall (Uint64 value) |
SDL_FORCE_INLINE float | marshall (float value) |
SDL_FORCE_INLINE double | marshall (double value) |
Vec2 & | operator*= (Vec2 &v, const Affine2 &m) |
const Vec2 | operator* (const Vec2 &v, const Affine2 &m) |
const Affine2 | operator* (float scalar, const Affine2 &m) |
const Color4f | operator* (float s, const Color4f &c) |
const Color4 | operator* (float s, Color4 c) |
Vec2 & | operator*= (Vec2 &v, const Mat4 &m) |
const Vec2 | operator* (const Vec2 &v, const Mat4 &m) |
Vec3 & | operator*= (Vec3 &v, const Mat4 &m) |
const Vec3 | operator* (const Vec3 &v, const Mat4 &m) |
Vec4 & | operator*= (Vec4 &v, const Mat4 &m) |
const Vec4 | operator* (const Vec4 &v, const Mat4 &m) |
const Mat4 | operator* (float scalar, const Mat4 &m) |
Vec3 & | operator*= (Vec3 &v, const Quaternion &quat) |
const Vec3 | operator* (const Vec3 &v, const Quaternion &quat) |
const Quaternion | operator* (float s, const Quaternion &quat) |
const Vec2 | operator* (float x, const Vec2 &v) |
const Vec3 | operator* (float x, const Vec3 &v) |
const Vec4 | operator* (float x, const Vec4 &v) |
std::string | to_string (Uint8 value) |
std::string | to_string (Sint16 value) |
std::string | to_string (Uint16 value) |
std::string | to_string (Sint32 value) |
std::string | to_string (Uint32 value) |
std::string | to_string (Sint64 value) |
std::string | to_string (Uint64 value) |
std::string | to_string (float value) |
std::string | to_string (double value) |
std::string | to_string (Uint8 *array, size_t length, size_t offset=0) |
std::string | to_string (Sint16 *array, size_t length, size_t offset=0) |
std::string | to_string (Uint16 *array, size_t length, size_t offset=0) |
std::string | to_string (Sint32 *array, size_t length, size_t offset=0) |
std::string | to_string (Uint32 *array, size_t length, size_t offset=0) |
std::string | to_string (Sint64 *array, size_t length, size_t offset=0) |
std::string | to_string (Uint64 *array, size_t length, size_t offset=0) |
std::string | to_string (float *array, size_t length, size_t offset=0) |
std::string | to_string (double *array, size_t length, size_t offset=0) |
Uint8 | stou8 (const std::string &str, std::size_t *pos=0, int base=10) |
Sint16 | stos16 (const std::string &str, std::size_t *pos=0, int base=10) |
Uint16 | stou16 (const std::string &str, std::size_t *pos=0, int base=10) |
Sint32 | stos32 (const std::string &str, std::size_t *pos=0, int base=10) |
Uint32 | stou32 (const std::string &str, std::size_t *pos=0, int base=10) |
Sint64 | stos64 (const std::string &str, std::size_t *pos=0, int base=10) |
Uint64 | stou64 (const std::string &str, std::size_t *pos=0, int base=10) |
float | stof (const std::string &str, std::size_t *pos=0) |
double | stod (const std::string &str, std::size_t *pos=0) |
Comment this out to use SDL sound on Mac/iOS (not recommended)
This type represents a listener for the Accelerometer class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
An event is delivered whenever the accleration delta (the difference between the current and previous value) exceeds the device threshold. See the method Accelerometer#getThreshold() for more information.
Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).
While accleration listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Acclerometer device.
The function type is equivalent to
std::function<void(const std::string& value, Timestamp stamp, bool focus)>
event | The acceleration event |
focus | Whether the listener currently has focus |
This type represents a listener for state change in the Button class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. For simplicity, Button nodes only support a single listener. If you wish for more than one listener, then your listener should handle its own dispatch.
The function type is equivalent to
std::function<void(const std::string& name, bool down)>
name | The button name |
clicks | Whether the button is now down |
This type represents a listener for a gesture in the GestureInput class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
While gesture listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the GestureInput device.
The function type is equivalent to
std::function<void(const GestureEvent& event, bool focus)>
event | The touch event for this gesture event |
focus | Whether the listener currently has focus |
This type represents a listener for a state change in the GestureInput class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
This type of listener responds to changes in the input device state. This is necessary because the GestureInput class cycles between many states and the state changes (such as from recording back to input matching) are asynchronous. As with all listeners, these functions guaranteed to be called at the start of an animation frame, before the method Application#update(float).
While state listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the GestureInput device.
The function type is equivalent to
std::function<void(GestureInput::State ostate, GestureInput::State nstate)>
ostate | The old input state |
nstate | The new input state |
This type represents a listener for the Keyboard class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
A Keyboard is designed to send input to a focused object (e.g. a text field or other UI widget). While only one listener can have focus at a time, all listeners will receive input from the Keyboard.
Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).
The function type is equivalent to
std::function<void(const KeyEvent& event, bool focus)>
code | The code for this key |
stamp | The timestamp for this event |
focus | Whether the listener currently has focus |
This type represents a callback for asynchronous asset loading
This callback is associated with an asset at the time of the asychronous load request. When the asset either loads, or fails to load, this callback is called with the asset status.
In the case of JSON asset directories, a single callback may be associated with several assets. In that case, the callback funtion is called each time that an asset loads or fails to load. If an entire node in the asset directory fails to load, the callback function will be notified using the key for that JSON node.
The function type is equivalent to
std::function<void(const std::string& key, bool success)>
key | The key to associate with the asset (or asset category) |
success | Whether the asset was successfully loaded |
This type represents a listener for button presses/releases in the Mouse class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
This type of listener only responds to button presses and releases, not mouse movement. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).
The listener does not receive any information indicating whether the event is a press or a release. That is handled when the listener is registered. On the other hand, the listener will get a counter if the press/release is a sequence of rapid clicks. This is a way of detecting double or even triple clicks. The click counter will continue to increment as long as there is a click every .5 seconds.
While mouse listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Mouse device.
The function type is equivalent to
std::function<void(const MouseEvent& event, Uint8 clicks, bool focus)>
event | The mouse event for this press/release |
clicks | The number of recent clicks, including this one |
focus | Whether the listener currently has focus |
This type represents a listener for movement in the Mouse class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
This type of listener only responds to mouse movement, not button presses or releases. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).
In addition the the mouse event, the listener will provide the previously registered mouse location. This will allow you to determin the relative mouse movement.
While mouse listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Mouse device.
The function type is equivalent to
std::function<void(const MouseEvent& event, const Vec2& previous, bool focus)>
event | The mouse event for this movement |
previous | The previous position of the mouse |
focus | Whether the listener currently has focus |
This type represents a listener for the mouse wheel in the Mouse class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
This type of listener only responds to the wheel mouse, not any other buttons or mouse movement. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).
While mouse listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Mouse device.
The function type is equivalent to
std::function<void(const MouseWheelEvent& event, bool focus)>
event | The mouse event for this wheel motion |
focus | Whether the listener currently has focus |
This type represents a listener for a pan in the PanInput class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
While pan listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the PanInput device.
The function type is equivalent to
std::function<void(const PanEvent& event, bool focus)>
event | The touch event for this pan event |
focus | Whether the listener currently has focus |
This type represents a listener for a pinch/zoom in the PinchInput class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
While pinch listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the PinchInput device.
The function type is equivalent to
std::function<void(const PinchEvent& event, bool focus)>
event | The touch event for this pinch/zoom |
focus | Whether the listener currently has focus |
typedef Vec2 cugl::Point2 |
Provide an alternative name for Vec2
typedef Vec3 cugl::Point3 |
Provide an alternative name for Vec3
This type represents a listener for a rotation in the RotationInput class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
While rotation listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the RotationInput device.
The function type is equivalent to
std::function<void(const RotationInput& event, bool focus)>
event | The touch event for this pinch/zoom |
focus | Whether the listener currently has focus |
This type represents a listener for the TextInput class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
A TextInput is designed to send input to a focused object (e.g. a text field or other UI widget). While only one listener can have focus at a time, all listeners will receive input from the TextInput.
This listener is called whenever text is appends to the buffer. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).
The function type is equivalent to
std::function<void(const TextInputEvent& event, bool focus)>
event | The input event for this append to the buffer |
focus | Whether the listener currently has focus |
This type represents a listener for validating text input. A validator checks whether intermediate input should be appended to the buffer. There may only be one validator at a time.
This function type is equivalent to
std::function<bool(const std::string& value)>
value | The character or string to append to the buffer |
typedef Sint64 cugl::TouchID |
This is the type representing a finger or touch
This type represents a listener for a press/release in the Touchscreen class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
This type of listener only responds to button presses and releases, not touch movement. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).
The listener does not receive any information indicating whether the event is a press or a release. That is handled when the listener is registered.
While touch listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Touchscreen device.
The function type is equivalent to
std::function<void(const TouchEvent& event, bool focus)>
event | The touch event for this press/release |
focus | Whether the listener currently has focus |
This type represents a listener for movement in the Touchscreen class.
In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.
This type of listener only responds to touch movement, not presses or releases. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).
In addition the the touch event, the listener will provide the previously registered touch location. This will allow you to determin the relative touch movement.
While touch listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Touchscreen device.
The function type is equivalent to
std::function<void(const TouchEvent& event, const Vec2& previous, bool focus)>
event | The touch event for this movement |
previous | The previous position of the touch |
focus | Whether the listener currently has focus |
|
strong |
This enum represents the current state of the gesture input device
Unlike most other input devices, this device can be in several different states as it cycles between recording and template matching. Gesture events will only be generated during the MATCHING state
|
strong |
This enum represents the category of the key
Categories are used to group key codes in rough groups
|
strong |
This is enum represents a key on a keyboard.
The keys available are subset of the full range of available keys. Because of our goal of cross-platform support, we only support keys that are found on most common keyboards.
The Input dispatcher will convert from an SDL keycode this enum. That means it is possible to receive a KeyCode that is not present in the enum. Any switch statement for this enum should have a default value.
|
strong |
The types of caps supported in an extrusion.
A cap is the rule for how to end an extruded line segment that has no neighbor on that end. If there is no cap, the path terminates at the end vertices.
This enumeration is used by both PathExtruder and PathNode.
|
strong |
The types of joints supported in an extrusion.
A joint is the rule for how to connect two extruded line segments. If there is not joint, the path will look like a sequence of overlapping rectangles.
This enumeration is used by both PathExtruder and PathNode.
|
strong |
This enum lists the types of path traversal that are supported.
This enumeration is used by both PathOutliner and WireNode.
SDL_FORCE_INLINE Uint16 cugl::marshall | ( | Sint16 | value | ) |
Returns the given value encoded in network order
On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.
This function is idempotent. To decode an encoded value, call this function on the value again.
value | The value to encode |
SDL_FORCE_INLINE Uint16 cugl::marshall | ( | Uint16 | value | ) |
Returns the given value encoded in network order
On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.
This function is idempotent. To decode an encoded value, call this function on the value again.
value | The value to encode |
SDL_FORCE_INLINE Uint32 cugl::marshall | ( | Sint32 | value | ) |
Returns the given value encoded in network order
On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.
This function is idempotent. To decode an encoded value, call this function on the value again.
value | The value to encode |
SDL_FORCE_INLINE Uint32 cugl::marshall | ( | Uint32 | value | ) |
Returns the given value encoded in network order
On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.
This function is idempotent. To decode an encoded value, call this function on the value again.
value | The value to encode |
SDL_FORCE_INLINE Uint64 cugl::marshall | ( | Sint64 | value | ) |
Returns the given value encoded in network order
On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.
This function is idempotent. To decode an encoded value, call this function on the value again.
value | The value to encode |
SDL_FORCE_INLINE Uint64 cugl::marshall | ( | Uint64 | value | ) |
Returns the given value encoded in network order
On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.
This function is idempotent. To decode an encoded value, call this function on the value again.
value | The value to encode |
SDL_FORCE_INLINE float cugl::marshall | ( | float | value | ) |
Returns the given value encoded in network order
On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.
This function is idempotent. To decode an encoded value, call this function on the value again.
value | The value to encode |
SDL_FORCE_INLINE double cugl::marshall | ( | double | value | ) |
Returns the given value encoded in network order
On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.
This function is idempotent. To decode an encoded value, call this function on the value again.
value | The value to encode |
|
inline |
Returns the bitwise and of two font styles.
Returns a copy of the vector after it is transformed.
v | The point to transform. |
m | The transform to apply. |
Multiplies the components of the given matrix by the specified scalar.
The scalar is applied to BOTH the core matrix and the offset.
scalar | The scalar value. |
m | The transform to scale. |
|
inline |
Returns a copy of the vector rotated by the quaternion.
The rotation is defined by the matrix associated with the vector. As per the convention for Mat4, we only allow vectors to be multiplied on the right by quaternions.
v | The vector to rotate. |
quat | The rotation quaternion. |
|
inline |
Returns the scalar product of the quaternion with the given value.
s | The value to scale by. |
quat | The quaternion to scale. |
Returns the scalar product of the given vector with the given value.
x | The value to scale by. |
v | The vector to scale. |
|
inline |
Returns the int equivalent of a font style.
Returns the scalar product of the given vector with the given value.
x | The value to scale by. |
v | The vector to scale. |
Returns the scalar product of the given vector with the given value.
x | The value to scale by. |
v | The vector to scale. |
Returns a copy of the vector transformed by the given matrix.
The vector is treated as a point, which means that translation is applied to the result.
v | The point to transform. |
m | The matrix to transform by. |
Returns a copy of the vector transformed by the given matrix.
The vector is treated as a point, which means that translation is applied to the result.
v | The point to transform. |
m | The matrix to transform by. |
Returns a copy of the vector transformed by the given matrix.
The vector is treated as is. Hence whether or not translation is applied depends on the value of w.
v | The point to transform. |
m | The matrix to transform by. |
Multiplies the components of the given matrix by the specified scalar.
scalar | The scalar value. |
m | The matrix to transform by. |
Returns the scalar product of the given color with the given value.
The scaling is clamped so that this remains a valid color.
This version of scaling always multiplies the alpha values.
s | The value to scale by. |
c | The color to scale. |
Returns the scalar product of the given color with the given value.
The scaling is clamped so that this remains a valid color.
This version of scaling always multiplies the alpha values.
s | The value to scale by. |
c | The color to scale. |
Transforms the given point in place.
v | The point to transform. |
m | The transform to apply. |
|
inline |
Rotates the vector in place by the quaternion.
The rotation is defined by the matrix associated with the vector. As per the convention for Mat4, we only allow vectors to be multiplied on the right by quaternions.
v | The vector to rotate. |
quat | The rotation quaternion. |
Transforms the given point by the given matrix.
The vector is treated as a point, which means that translation is applied to the result.
v | The point to transform. |
m | The matrix to transform by. |
Transforms the given point by the given matrix.
The vector is treated as a point, which means that translation is applied to the result.
v | The point to transform. |
m | The matrix to transform by. |
Transforms the given point by the given matrix.
The vector is treated as is. Hence whether or not translation is applied depends on the value of w.
v | The point to transform. |
m | The matrix to transform by. |
|
inline |
Returns the bitwise exclusive or of two font styles.
|
inline |
Returns the bitwise or of two font styles.
|
inline |
Returns the bitwise complement of a font style.
double cugl::stod | ( | const std::string & | str, |
std::size_t * | pos = 0 |
||
) |
Returns the double equivalent to the given string
This function discards any whitespace characters (as determined by std::isspace()) until first non-whitespace character is found. Then it takes as many characters as possible to form a valid floating point representation and converts them to a floating point value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
float cugl::stof | ( | const std::string & | str, |
std::size_t * | pos = 0 |
||
) |
Returns the float equivalent to the given string
This function discards any whitespace characters (as determined by std::isspace()) until first non-whitespace character is found. Then it takes as many characters as possible to form a valid floating point representation and converts them to a floating point value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
Sint16 cugl::stos16 | ( | const std::string & | str, |
std::size_t * | pos = 0 , |
||
int | base = 10 |
||
) |
Returns the signed 16 bit integer equivalent to the given string
This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
base | the number base |
Sint32 cugl::stos32 | ( | const std::string & | str, |
std::size_t * | pos = 0 , |
||
int | base = 10 |
||
) |
Returns the signed 32 bit integer equivalent to the given string
This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
base | the number base |
Sint64 cugl::stos64 | ( | const std::string & | str, |
std::size_t * | pos = 0 , |
||
int | base = 10 |
||
) |
Returns the signed 64 bit integer equivalent to the given string
This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
base | the number base |
Uint16 cugl::stou16 | ( | const std::string & | str, |
std::size_t * | pos = 0 , |
||
int | base = 10 |
||
) |
Returns the unsigned 16 bit integer equivalent to the given string
This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
base | the number base |
Uint32 cugl::stou32 | ( | const std::string & | str, |
std::size_t * | pos = 0 , |
||
int | base = 10 |
||
) |
Returns the unsigned 32 bit integer equivalent to the given string
This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
base | the number base |
Uint64 cugl::stou64 | ( | const std::string & | str, |
std::size_t * | pos = 0 , |
||
int | base = 10 |
||
) |
Returns the unsigned 64 bit integer equivalent to the given string
This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
base | the number base |
Uint8 cugl::stou8 | ( | const std::string & | str, |
std::size_t * | pos = 0 , |
||
int | base = 10 |
||
) |
Returns the byte equivalent to the given string
This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to an integer value.
str | the string to convert |
pos | address of an integer to store the number of characters processed |
base | the number base |
std::string cugl::to_string | ( | Uint8 | value | ) |
Returns a string equivalent to the given byte
The value is displayed as a number, not a character.
value | the numeric value to convert |
std::string cugl::to_string | ( | Sint16 | value | ) |
Returns a string equivalent to the given signed 16 bit integer
value | the numeric value to convert |
std::string cugl::to_string | ( | Uint16 | value | ) |
Returns a string equivalent to the given unsigned 16 bit integer
value | the numeric value to convert |
std::string cugl::to_string | ( | Sint32 | value | ) |
Returns a string equivalent to the given signed 32 bit integer
value | the numeric value to convert |
std::string cugl::to_string | ( | Uint32 | value | ) |
Returns a string equivalent to the given unsigned 32 bit integer
value | the numeric value to convert |
std::string cugl::to_string | ( | Sint64 | value | ) |
Returns a string equivalent to the given signed 64 bit integer
value | the numeric value to convert |
std::string cugl::to_string | ( | Uint64 | value | ) |
Returns a string equivalent to the given unsigned 64 bit integer
value | the numeric value to convert |
std::string cugl::to_string | ( | float | value | ) |
Returns a string equivalent to the given float value
The precision is the same as std::to_string(float).
value | the numeric value to convert |
std::string cugl::to_string | ( | double | value | ) |
Returns a string equivalent to the given double value
The precision is the same as std::to_string(double).
value | the numeric value to convert |
std::string cugl::to_string | ( | Uint8 * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the given byte array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |
std::string cugl::to_string | ( | Sint16 * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the signed 16 bit integer array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |
std::string cugl::to_string | ( | Uint16 * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the unsigned 16 bit integer array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |
std::string cugl::to_string | ( | Sint32 * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the signed 32 bit integer array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |
std::string cugl::to_string | ( | Uint32 * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the unsigned 32 bit integer array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |
std::string cugl::to_string | ( | Sint64 * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the signed 64 bit integer array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |
std::string cugl::to_string | ( | Uint64 * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the unsigned 64 bit integer array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |
std::string cugl::to_string | ( | float * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the given float array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |
std::string cugl::to_string | ( | double * | array, |
size_t | length, | ||
size_t | offset = 0 |
||
) |
Returns a string equivalent to the given double array
The value is display as a python-style list in brackets.
array | the array to convert |
length | the array length |
offset | the starting position in the array |