ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

util.h File Reference

#include "common/scummsys.h"
#include "common/str.h"
Include dependency graph for util.h:

Go to the source code of this file.

Namespaces

namespace  Common
 

Internal interface to the QuickTime audio decoder.


Defines

#define IS_ALIGNED(value, alignment)   ((((size_t)value) & ((alignment) - 1)) == 0)
 Check whether a given pointer is aligned correctly.
#define ARRAYSIZE(x)   ((int)(sizeof(x) / sizeof(x[0])))
 Macro which determines the number of entries in a fixed size array.
#define ARRAYEND(x)   ((x) + ARRAYSIZE((x)))
 Compute a pointer to one past the last element of an array.
#define SCUMMVM_CURRENT_FUNCTION   "<unknown>"
 This macro evaluates to the current function's name on compilers supporting this.

Functions

template<typename T >
ABS (T x)
template<typename T >
MIN (T a, T b)
template<typename T >
MAX (T a, T b)
template<typename T >
CLIP (T v, T amin, T amax)
template<typename T >
void SWAP (T &a, T &b)
 Template method which swaps the vaulues of its two parameters.
void Common::hexdump (const byte *data, int len, int bytesPerLine=16, int startOffset=0)
 Print a hexdump of the data passed in.
bool Common::parseBool (const String &val, bool &valAsBool)
 Parse a string for a boolean value.
bool Common::isAlnum (int c)
 Test whether the given character is alphanumeric (a-z, A-Z, 0-9).
bool Common::isAlpha (int c)
 Test whether the given character is an alphabetic letter (a-z, A-Z).
bool Common::isDigit (int c)
 Test whether the given character is a decimal-digit (0-9).
bool Common::isXDigit (int c)
 Test whether the given character is a hwzadecimal-digit (0-9 or A-F).
bool Common::isLower (int c)
 Test whether the given character is a lower-case letter (a-z).
bool Common::isSpace (int c)
 Test whether the given character is a white-space.
bool Common::isUpper (int c)
 Test whether the given character is an upper-case letter (A-Z).
bool Common::isPrint (int c)
 Test whether the given character is printable.
bool Common::isPunct (int c)
 Test whether the given character is a punctuation character, (i.e not alphanumeric.

Define Documentation

#define ARRAYEND (   x  )     ((x) + ARRAYSIZE((x)))

Compute a pointer to one past the last element of an array.

Definition at line 71 of file util.h.

#define ARRAYSIZE (   x  )     ((int)(sizeof(x) / sizeof(x[0])))

Macro which determines the number of entries in a fixed size array.

Definition at line 66 of file util.h.

#define IS_ALIGNED (   value,
  alignment 
)    ((((size_t)value) & ((alignment) - 1)) == 0)

Check whether a given pointer is aligned correctly.

Note that 'alignment' must be a power of two!

Definition at line 33 of file util.h.

#define SCUMMVM_CURRENT_FUNCTION   "<unknown>"

This macro evaluates to the current function's name on compilers supporting this.

Definition at line 85 of file util.h.


Function Documentation

template<typename T >
T ABS ( x  )  [inline]

Definition at line 48 of file util.h.

template<typename T >
T CLIP ( v,
amin,
amax 
) [inline]

Definition at line 51 of file util.h.

template<typename T >
T MAX ( a,
b 
) [inline]

Definition at line 50 of file util.h.

template<typename T >
T MIN ( a,
b 
) [inline]

Definition at line 49 of file util.h.

template<typename T >
void SWAP ( T &  a,
T &  b 
) [inline]

Template method which swaps the vaulues of its two parameters.

Definition at line 57 of file util.h.



Generated on Sat Nov 9 2019 05:00:42 for ResidualVM by doxygen 1.7.1
curved edge   curved edge