MercuryUtil.cpp File Reference

#include "MercuryFiles.h"
#include "MercuryUtil.h"
#include "Crash/archCrash.h"

Go to the source code of this file.

Functions

void Sleep (float msec)
MString ConvertToCFormat (const MString &ncf)
 Convert string containing binary characters to C-style formatted string.
MString ConvertToUnformatted (const MString &cf)
 Convert a C-style formatted string into it's binary string equivalent.
long DumpFromFile (const MString &filename, char *&data)
 Dump data from a file into a char * and return the size of data. If -1 then there was an error opening the file.
bool DumpToFile (const MString &filename, const char *data, long bytes)
 Dump data into the file filename. bytes specifies the length of data. Returns true if successful, false else.
void FileToMString (const MString &filename, MString &data)
 Dump the contents of a file to data.
void MStringToFile (const MString &filename, const MString &data)
 Dump data into file.
bool FileExists (const MString &filename)
long BytesUntil (const char *strin, const char *termin, long start, long slen, long termlen)
 Bytes until desired terminal.
long BytesNUntil (const char *strin, const char *termin, long start, long slen, long termlen)
 Bytes until something other than a terminal.
void SplitStrings (const MString &in, MVector< MString > &out, const char *termin, const char *whitespace, long termlen, long wslen)
 Split given string into other strings using delimiters from termin.
void mercury_crash (const char *reason)
 Force mercury to crash and write the reason at the top of the crashlog.
int GetAPrime (int ith)
 Redefinition of function from MercuryUtil.h.

Variables

int GeneralUsePrimes [] = { 3, 13, 37, 73, 131, 229, 337, 821, 2477, 4594, 8941, 14797, 24953, 39041, 60811, 104729 }


Function Documentation

long BytesNUntil ( const char *  strin,
const char *  termin,
long  start,
long  slen,
long  termlen 
)

Bytes until something other than a terminal.

Definition at line 173 of file MercuryUtil.cpp.

long BytesUntil ( const char *  strin,
const char *  termin,
long  start,
long  slen,
long  termlen 
)

Bytes until desired terminal.

Definition at line 163 of file MercuryUtil.cpp.

MString ConvertToCFormat ( const MString ncf  ) 

Convert string containing binary characters to C-style formatted string.

Definition at line 26 of file MercuryUtil.cpp.

MString ConvertToUnformatted ( const MString cf  ) 

Convert a C-style formatted string into it's binary string equivalent.

Definition at line 57 of file MercuryUtil.cpp.

long DumpFromFile ( const MString filename,
char *&  data 
)

Dump data from a file into a char * and return the size of data. If -1 then there was an error opening the file.

Definition at line 105 of file MercuryUtil.cpp.

bool DumpToFile ( const MString filename,
const char *  data,
long  bytes 
)

Dump data into the file filename. bytes specifies the length of data. Returns true if successful, false else.

Definition at line 128 of file MercuryUtil.cpp.

bool FileExists ( const MString filename  ) 

Definition at line 154 of file MercuryUtil.cpp.

void FileToMString ( const MString filename,
MString data 
)

Dump the contents of a file to data.

Definition at line 141 of file MercuryUtil.cpp.

int GetAPrime ( int  ith  ) 

Redefinition of function from MercuryUtil.h.

Return a prime number. Note this is NOT sequential. The general(but not guarenteed) pattern is the next prime number that's roughly two times the last.

Definition at line 218 of file MercuryUtil.cpp.

void mercury_crash ( const char *  reason  ) 

Force mercury to crash and write the reason at the top of the crashlog.

Definition at line 206 of file MercuryUtil.cpp.

void MStringToFile ( const MString filename,
const MString data 
)

Dump data into file.

Definition at line 149 of file MercuryUtil.cpp.

void Sleep ( float  msec  ) 

Definition at line 9 of file MercuryUtil.cpp.

void SplitStrings ( const MString in,
MVector< MString > &  out,
const char *  termin,
const char *  whitespace,
long  termlen,
long  wslen 
)

Split given string into other strings using delimiters from termin.

Definition at line 190 of file MercuryUtil.cpp.


Variable Documentation

int GeneralUsePrimes[] = { 3, 13, 37, 73, 131, 229, 337, 821, 2477, 4594, 8941, 14797, 24953, 39041, 60811, 104729 }

Definition at line 216 of file MercuryUtil.cpp.


Hosted by SourceForge.net Logo