Windows125xStringPointerAssertions
Short summary
This class provides assert statements for Windows-1252 and Windows-1251 strings.
Used encoding is specified in Tc2_Utilities.GLOBAL_SBCS_TABLE global variable
Attention: All strings are handled as null-terminated byte streams
| Access | Abstract | Final | Extends | Implements |
|---|---|---|---|---|
| INTERNAL | No | No | AbstractStringPointerAssertions | IWindows125xStringPointerAssertions |
UML Diagram
Properties
className
Type: CNM_AbstractObject.ClassName
This abstract property returns the class name of the concrete object, …
Methods
contains
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checksearchString(POINTER TO BYTE): string must be found instringToCheckignoreCases(BOOL):TRUEmeans ignore cases;FALSEmeans that cases must be equal toomessage(AssertMessage): message if the assertion is falsesbcsType(Tc2_Utilities.E_SBCSType): used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE
- Return type:
VOID
This assertion method checks if the current string stringToCheck contains the search string searchString.…
containsNo
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checksearchString(POINTER TO BYTE): string must be found instringToCheckignoreCases(BOOL):TRUEmeans ignore cases;FALSEmeans that cases must be equal toomessage(AssertMessage): message if the assertion is falsesbcsType(Tc2_Utilities.E_SBCSType): used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE
- Return type:
VOID
This assertion method checks if the current string stringToCheck doesn't contain the search string searchString.…
endsWith
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checkend(POINTER TO BYTE): string must be the end ofstringToCheckignoreCases(BOOL):TRUEmeans ignore cases;FALSEmeans that cases must be equal tootrim(BOOL):TRUEmeans truncation of spaces on the right side ofstringToCheckmessage(AssertMessage): message if the assertion is falsesbcsType(Tc2_Utilities.E_SBCSType): used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE
- Return type:
VOID
This assertion method checks if the current string stringToCheck ends with the string end.…
freeMemory
- Parameters:
stringAddress(POINTER TO BYTE): start address of the memory to freefreeAllocatedMemory(BOOL):TRUEmeans free the memory,FALSEmeans do not free the memory
- Return type:
VOID
This method is used to free allocated memory if needed…
getNewUpperCaseString
- Parameters:
stringAddress(POINTER TO BYTE): start address of the string to copy and capitalizestringLength(UDINT): length of the stringstringAddresscreateNewUpperCaseString(BOOL):TRUE means meake a copy and capitalize it,FALSEmeans return juststringAddress`` and do nothing elsesbcsType(Tc2_Utilities.E_SBCSType): used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE
- Return type:
POINTER TO BYTE
this methods copy a string and returns the start address of new string,…
getStringCopy
- Parameters:
stringAddress(POINTER TO BYTE): string to copystringLength(UDINT): length of the string
- Return type:
POINTER TO BYTE
this methods copy a string and returns the start address of new string…
getStringLength
- Parameters:
stringAddress(POINTER TO BYTE): Start address of the string for which the length is to be determined
- Return type:
UDINT
this methods returns the length of a null-terminated string in bytes…
isCharWhiteSpace
- Parameters:
character(BYTE): character to check if it's whitespace
- Return type:
BOOL
this methods checks if a windows-1252 or a windows-1251 character is a whitespace character…
isEqualTo
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checkexpected(POINTER TO BYTE):stringToCheckmust be equal to expectedignoreCases(BOOL):TRUEmeans ignore cases;FALSEmeans that cases must be equal toomessage(AssertMessage): message if the assertion is falsesbcsType(Tc2_Utilities.E_SBCSType): used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE
- Return type:
VOID
This assertion method checks if the current string stringToCheck is equal to expected.…
isNotEqualTo
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checkunexpected(POINTER TO BYTE):stringToCheckmust be not equal to expectedignoreCases(BOOL):TRUEmeans ignore cases;FALSEmeans that cases must be equal toomessage(AssertMessage): message if the assertion is falsesbcsType(Tc2_Utilities.E_SBCSType): used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE
- Return type:
VOID
This assertion method checks if the current string stringToCheck is not equal to unexpected.…
lengthIsBetween
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checkminLength(UDINT): lower limit of the string lengthmaxLength(UDINT): upper limit of the string lengthmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current string stringToCheck length is between minLength and maxLength.…
lengthIsExact
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checkexpectedLength(UDINT): expected length ofstringToCheckmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current string stringToCheck length is equal to expectedLength.…
lengthIsMax
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checkmaxLength(UDINT): upper limit of the length ofstringToCheckmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current string stringToCheck length is equal or less than to maxLength.…
lengthIsMin
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checkminLength(UDINT): lower limit of the length ofstringToCheckmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current string stringToCheck length is equal or greater than to minLength.…
startsWith
- Parameters:
stringToCheck(POINTER TO BYTE): current string to checkstart(POINTER TO BYTE): expected start ofstringToCheckignoreCases(BOOL):TRUEmeans ignore cases;FALSEmeans that cases must be equal tootrim(BOOL):TRUEmeans truncation of spaces on the left side ofstringToCheckmessage(AssertMessage): message if the assertion is falsesbcsType(Tc2_Utilities.E_SBCSType): used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE
- Return type:
VOID
This assertion method checks if the current string stringToCheck starts with string start.…
trimLeft
- Parameters:
stringAddress(POINTER TO BYTE): start address of the stringstringLength(UDINT): length of the stringstringAddresstrimString(BOOL):TRUEmeans remove the whitespace,FALSEmeans do not remove the whitespace
- Return type:
VOID
This method is used to remove the whitespace from the start of the string.…
trimRight
- Parameters:
stringAddress(POINTER TO BYTE): start address of the stringstringLength(UDINT): length of the stringstringAddresstrimString(BOOL):TRUEmeans remove the whitespace,FALSEmeans do not remove the whitespace
- Return type:
VOID
This method is used to remove the whitespace from the end of the string.…
upperCase
- Parameters:
stringAddress(POINTER TO BYTE): string to ucasestringLength(UDINT): length of the stringsbcsType(Tc2_Utilities.E_SBCSType): used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE
- Return type:
VOID
This method converts the lowercase letters in an 8 bit windows-1252 or windows-1251…
upperCase1251
- Parameters:
stringAddress(POINTER TO BYTE): string to ucasestringLength(UDINT): length of the string
- Return type:
VOID
This method converts the lowercase letters in an 8 bit windows-1251…
upperCase1252
- Parameters:
stringAddress(POINTER TO BYTE): string to ucasestringLength(UDINT): length of the string
- Return type:
VOID
This method converts the lowercase letters in an 8 bit windows-1252 …
Code
Declaration
{attribute 'reflection'}
FUNCTION_BLOCK INTERNAL Windows125xStringPointerAssertions EXTENDS AbstractStringPointerAssertions IMPLEMENTS IWindows125xStringPointerAssertions