CAIUtil Class

Utility class

Quick Ref

virtual long __cdecl CAIUtil::CountSquares(CPoint& start, CPoint& end) = 0

virtual CString __cdecl CAIUtil::ReadAfterChar(CString& line, char c) = 0

virtual CString __cdecl CAIUtil::ReadBetween(CString& in, CString pattern) = 0

virtual CString __cdecl CAIUtil::ReadTo(CString& in, CString pattern, int updateIn) = 0

virtual CString __cdecl CAIUtil::ReadToChar(CString& line, char c) = 0

virtual CString __cdecl CAIUtil::RemoveAllWS(CString in) = 0

virtual long __cdecl CAIUtil::RangeSquared(CPoint start, CPoint end) = 0


Methods

Name

Description

CAIUtil::CountSquares

Count all squares in the specified points

CAIUtil::ReadAfterChar

Reads a string and returns the portion of the string after the specified character

CAIUtil::ReadBetween

Reads a string and returns the portion of the string that matches the pattern specified

CAIUtil::ReadTo

Reads a string and returns the portion of the string that matches up to the pattern

CAIUtil::ReadToChar

Reads a string and returns the portion of the string before and upto the specified char

CAIUtil::RemoveAllWS

Removes all whitespace characters (space, tab, line feed, carriage return) from a string

CAIUtil::RangeSquared

Returns the range squared of the specified points

CAIUtil::CountSquares

Count all squares in the specified points

virtual long __cdecl CAIUtil::CountSquares(
   CPoint& start,
   CPoint& end);

Parameters

  • CPoint& start - start coordinates

  • CPoint& end - end coordinates

Return Value

Returns a long value representing the count of squares

Remarks


CAIUtil::ReadAfterChar

Read a string and returns the portion of the string after the specified character

virtual CString __cdecl CAIUtil::ReadAfterChar(
   CString& line,
   char c);

Parameters

  • CString& line - the source string to read

  • char c - the character byte to start reading the portion of the string after

Return Value

Returns a CString as the portion of the string read

Remarks


CAIUtil::ReadBetween

Reads a string and returns the portion of the string that matches the pattern specified

virtual CString __cdecl CAIUtil::ReadBetween(
   CString& in,
   CString pattern);

Parameters

  • CString& in - the source string to read

  • CString pattern - the string pattern to match

Return Value

CString

Remarks


CAIUtil::ReadTo

Reads a string and returns the portion of the string that matches up to the pattern specified

virtual CString __cdecl CAIUtil::ReadTo(
   CString& in,
   CString pattern,
   int updateIn);

Parameters

  • CString& in - the source string to read

  • CString pattern - the string pattern to match

  • int updateIn -

Return Value

CString

Remarks


CAIUtil::ReadToChar

Reads a string and returns the portion of the string before and upto the specified character

virtual CString __cdecl CAIUtil::ReadToChar(
   CString& line,
   char c);

Parameters

  • CString& line - the source string to read

  • char c - the character byte to start reading the portion of the string before and upto

Return Value

Returns a CString as the portion of the string read

Remarks


CAIUtil::RemoveAllWS

Removes all whitespace characters (space, tab, line feed, carriage return) from a string

virtual CString __cdecl CAIUtil::RemoveAllWS(CString in);

Parameters

  • CString in - the source string to strip of whitespace

Return Value

Returns a CString which has all the whitespace characters removed

Remarks


CAIUtil::RangeSquared

Returns the range squared of the specified points

virtual long __cdecl CAIUtil::RangeSquared(
   CPoint start,
   CPoint end);

Parameters

  • CPoint start - start coordinate for range

  • CPoint end - end coordinates for range

Return Value

Returns a long value

Remarks