MoSync 3.3
MAUtil Namespace Reference

MoSync utility libraries. More...

Namespaces

namespace  PlaceholderPool
 

A dynamic pool of MoSync placeholder resource handles.


Classes

class  BluetoothConnection
 Can connect to a Bluetooth service by UUID. Works mostly like a Connection, except the connect() method is different. More...
struct  BtDevice
 A C++ representation of a Bluetooth device. More...
struct  BtService
 A C++ representation of a Bluetooth service. More...
class  BluetoothDeviceDiscoveryListener
 An interface for listening to Bluetooth device discovery events. More...
class  BluetoothServiceDiscoveryListener
 An interface for listening to Bluetooth service discovery events. More...
class  BluetoothDiscoverer
 A class that connects to Environment and handles Bluetooth discovery operations. More...
class  BuffDownloadListener
 Listener for events from the BuffDownloader class. More...
class  BuffDownloader
 Simplifies asynchronous downloading of data to a memory buffer. More...
class  CharInputListener
 A listener for character input events. More...
class  CharInput
 A C++ wrapper for the text input system. More...
struct  Pair
 Template storage for a pair of objects. More...
class  ConnectionListener
 A listener for events from the Connection class. All the default implementations call maPanic(). More...
class  Connection
 An Environment-based communications class. Encapsulates MoSync's basic connection system, which supports, for example, TCP, HTTP and Bluetooth. More...
class  HttpConnectionListener
 A listener for events from the HttpConnection class. More...
class  HttpConnection
 This class describes a single HTTP 1.0 operation. More...
class  DataHandler
 Facilitates consecutive reads and writes to a MoSync data object. More...
class  Dictionary
 Thin template sorted Dictionary. More...
class  DownloadListener
 A listener for events from the Downloader class. More...
class  DownloadController
 Controls certain aspects of Downloader behavior. More...
class  Downloader
 The Downloader class. Use it to simplify asynchronous downloading of files to binary resources. More...
class  ImageDownloader
 The ImageDownloader class. Use it to simplify asynchronous downloading of images to image resources. More...
class  AudioDownloader
 The AudioDownloader class. Use it to simplify asynchronous downloading of audio to audio resources. Note that for AudioDownloader to work, the server must return a content-length header in the HTTP response. More...
class  DownloaderReader
 Base class for classes that perform the download. More...
class  DownloaderReaderWithKnownContentLength
 Class that handles download when content-length is known. More...
class  DownloaderReaderThatReadsChunks
 Class that handles download when content-length is NOT known. Here we read in chunks until we get result CONNERR_CLOSED in connRecvFinished. More...
class  KeyListener
 A listener for keypad events. More...
class  PointerListener
 A listener for pointer events. More...
class  BluetoothListener
 A listener for Bluetooth Discovery events. More...
class  ConnListener
 A listener for Connection events. More...
class  CloseListener
 A listener for the Close event. More...
class  IdleListener
 A listener whose function is called whenever nothing else has to be done. More...
class  TimerListener
 A listener for timer events. More...
class  FocusListener
 A listener for focus events. More...
class  CustomEventListener
 A listener for custom events. More...
class  TextBoxListener
 A listener for maTextBox events. More...
class  SensorListener
 A listener for maSensor events. More...
class  OrientationListener
 A listener for orientation changes. Note: If the application uses NativeUI, it is preffered to use Screen::addScreenListener() instead, so that all events will be received for specific screens. More...
class  MediaExportListener
 A listener for media export operations. More...
class  CameraListener
 A listener for camera events. More...
class  Environment
 A base class for cross-platform event managers. More...
class  Point
 Point geometric helper structure/function. More...
class  Rect
 Rect geometric helper structure/function. More...
class  GLMoblet
 OpenGL|ES fullscreen moblet. More...
class  HashDict
 Thin template unsorted dictionary. More...
class  HashMap
 Thin template HashMap. More...
class  HashSet
 Thin template HashSet. More...
class  List
 A generic, dynamic list container. More...
class  ListenerSet
 A listener set. More...
class  Map
 Thin template sorted Map. More...
class  Moblet
 A C++ event manager, a base class for applications. More...
class  RefCounted
 A base class for reference counting. More...
class  ServerListener
 Receives events from MAUtil::Server. More...
class  Server
 Encapsulates MoSync's server connections. Use this class to listen for incoming connections. More...
class  Set
 Thin template sorted Set. More...
class  Stack
 Generic, dynamic stack container. A restricted subset of vector. More...
class  StringData
 A class that holds the actual data used by String. More...
class  BasicString
 A dynamic, reference-counted string that behaves much like a subset of std::string. More...
class  Vector
 A generic, dynamic, random-access container. More...

Typedefs

typedef BasicString< char > String
typedef BasicString< wchar_t > WString

Enumerations

enum  PLATFORM_TYPE { OS_IOS = 0, OS_ANDROID, OS_WIN, OS_UNKNOWN }

Functions

template<class T >
int Compare (const T &a, const T &b)
 Template comparator function. Returns -1 if a < b, 0 if a == b and 1 if a > b.
template<class Key >
hash_val_t THashFunction (const Key &)
template<>
hash_val_t THashFunction (const String &)
template<>
hash_val_t THashFunction (const int &)
template<class Tchar >
BasicString< Tchar > operator+ (const Tchar *c, const BasicString< Tchar > &s)
double clamp (double v, double a, double b)
int clamp (int v, int a, int b)
unsigned int clamp (unsigned int f, unsigned int a, unsigned int b)
double wrapInRange (double v, double a, double b)
bool inside (double a, double f, double b)
bool inside (int a, int b, int c)
bool inside (unsigned int a, unsigned int b, unsigned int c)
String doubleToString (double f, int decimals=5)
String integerToString (int i, int base=10)
String lowerString (const String &s)
String upperString (const String &s)
void stringSplit (const String &str, const String &delim, MAUtil::Vector< String > &output)
int stringToInteger (const String &s, int base=10)
double stringToDouble (const String &s)
void stringBreak (const char *str, const char *delim, MAUtil::Vector< String > &output)
void stringBreak (const wchar_t *str, const wchar_t *delim, MAUtil::Vector< WString > &output)

Detailed Description

MoSync utility libraries.


Typedef Documentation

typedef BasicString<char> MAUtil::String
typedef BasicString<wchar_t> MAUtil::WString

Enumeration Type Documentation

Enumerator:
OS_IOS 
OS_ANDROID 
OS_WIN 
OS_UNKNOWN 

Function Documentation

template<class T >
int MAUtil::Compare ( const T &  a,
const T &  b 
)

Template comparator function. Returns -1 if a < b, 0 if a == b and 1 if a > b.

template<class Key >
hash_val_t MAUtil::THashFunction ( const Key &  )
template<>
hash_val_t MAUtil::THashFunction ( const String &  )
template<>
hash_val_t MAUtil::THashFunction ( const int &  )
template<class Tchar >
BasicString<Tchar> MAUtil::operator+ ( const Tchar *  c,
const BasicString< Tchar > &  s 
) [inline]
Returns:
A new string that is the concatenation of c and s.
double MAUtil::clamp ( double  v,
double  a,
double  b 
)

Returns v clamped to the (a..b) range, inclusively. If v is greater than b, b is returned. If v is less than a, a is returned. Otherwise, v is returned.

int MAUtil::clamp ( int  v,
int  a,
int  b 
)

Returns v clamped to the (a..b) range, inclusively. If v is greater than b, b is returned. If v is less than a, a is returned. Otherwise, v is returned.

unsigned int MAUtil::clamp ( unsigned int  f,
unsigned int  a,
unsigned int  b 
)

Returns v clamped to the (a..b) range, inclusively. If v is greater than b, b is returned. If v is less than a, a is returned. Otherwise, v is returned.

double MAUtil::wrapInRange ( double  v,
double  a,
double  b 
)

Returns v wrapped in the (a..b) range, inclusively. If v is greater than b, it 'wraps' back from a and conversely.

bool MAUtil::inside ( double  a,
double  f,
double  b 
)

Returns f >= a && f <= b.

bool MAUtil::inside ( int  a,
int  b,
int  c 
)

Returns f >= a && f <= b.

bool MAUtil::inside ( unsigned int  a,
unsigned int  b,
unsigned int  c 
)

Returns f >= a && f <= b.

String MAUtil::doubleToString ( double  f,
int  decimals = 5 
)

Converts f to its string representation, with decimals fractional digits.

String MAUtil::integerToString ( int  i,
int  base = 10 
)

Converts f to its string representation in radix base.

String MAUtil::lowerString ( const String &  s)

Converts a MAUtil::String to lowercase.

String MAUtil::upperString ( const String &  s)

Converts a MAUtil::String to uppercase.

void MAUtil::stringSplit ( const String &  str,
const String &  delim,
MAUtil::Vector< String > &  output 
)

Splits str into multiple strings, one for each occurance of the entire delim substring. output is cleared, then the resulting strings are added to it.

int MAUtil::stringToInteger ( const String &  s,
int  base = 10 
)

Converts a string to an integer, using the same semantics as strtoul().

double MAUtil::stringToDouble ( const String &  s)

Converts a string to a double, using the same semantics as atof().

void MAUtil::stringBreak ( const char *  str,
const char *  delim,
MAUtil::Vector< String > &  output 
)

Splits str into multiple strings, breaking at the occurrence of any character in delim. output is cleared, then the resulting strings are added to it.

void MAUtil::stringBreak ( const wchar_t *  str,
const wchar_t *  delim,
MAUtil::Vector< WString > &  output 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines