Utilities Class Reference

#include <Utilities.hpp>

Static Public Member Functions

static int strCaselessCompare (const char *opt1, const char *opt2)
 
static int memicmp (const void *opt1, const void *opt2, size_t len)
 
static void strupper (char *str)
 
static void strlower (char *str)
 
static const char * strnchr (const char *, sizeB_t n, char ch)
 
static const char * locateCharacter (const char *s, const char *set, sizeB_t l)
 
static int vsnprintf (char *buffer, size_t count, const char *format, va_list args)
 
static int snprintf (char *buffer, size_t count, const char *format,...)
 
static wholenumber_t currentThreadId ()
 
static void traceConcurrency (bool)
 
static bool traceConcurrency ()
 
static void traceParsing (bool)
 
static bool traceParsing ()
 

Detailed Description

Definition at line 56 of file Utilities.hpp.

Member Function Documentation

◆ currentThreadId()

◆ locateCharacter()

const char * Utilities::locateCharacter ( const char *  s,
const char *  set,
sizeB_t  l 
)
static

Definition at line 52 of file Utilities.cpp.

Referenced by RexxSource::initBuffered().

◆ memicmp()

int Utilities::memicmp ( const void *  mem1,
const void *  mem2,
size_t  len 
)
static

Portable implementation of a caseless memory compare.

Parameters
opt1First memory location to compare.
opt2Second memory location.
lenLength to compare.
Returns
The compare result. Returns 0, negative, or positive depending one the ordering compare result.

Definition at line 107 of file Utilities.cpp.

Referenced by StreamToken::equals().

◆ snprintf()

int Utilities::snprintf ( char *  buffer,
size_t  count,
const char *  format,
  ... 
)
static

Encapsulation of snprintf Unix implementation. The goal is to have the same behavior on all platforms.

Parameters
bufferBuffer receiving the formated output.
sizeSize of buffer.
formatFormat string.
...Optional arguments
Returns
Upon successful completion, return the number of bytes stored in buffer, not counting the terminating null character or a negative value if an error was encountered.

Encapsulation of snprintf Windows implementation. The goal is to have the same behavior on all platforms.

Parameters
bufferBuffer receiving the formated output.
sizeSize of buffer.
formatFormat string.
...Optional arguments
Returns
Upon successful completion, return the number of bytes stored in buffer, not counting the terminating null character or a negative value if an error was encountered.

Definition at line 113 of file unix/SysUtilities.cpp.

References vsnprintf().

Referenced by RexxToken::codeText(), RexxToken::keywordText(), and RexxActivity::traceOutput().

◆ strCaselessCompare()

int Utilities::strCaselessCompare ( const char *  op1,
const char *  op2 
)
static

Portable implementation of an ascii-z caseless string compare.

Parameters
opt1First string argument
opt2Second string argument.
Returns
The compare result. Returns 0, negative, or positive depending one the ordering compare result.

Definition at line 82 of file Utilities.cpp.

Referenced by RexxObject::defMethod(), RexxSource::initFile(), NameTable::inTable(), LocalQueueManager::isSessionQueue(), MacroTable::locate(), QueueTable::locate(), RegistrationData::matches(), StreamInfo::openStd(), MacroTable::remove(), QueueTable::remove(), RexxObject::setMethod(), RexxString::strCaselessCompare(), systemCommandHandler(), traceConcurrency(), traceParsing(), and LocalQueueManager::validateQueueName().

◆ strlower()

void Utilities::strlower ( char *  str)
static

Portable implementation of an ascii-z string to uppercase (in place).

Parameters
strString argument
Returns
The address of the str unput argument.

Definition at line 151 of file Utilities.cpp.

Referenced by SysFileSystem::primitiveSearchName().

◆ strnchr()

const char * Utilities::strnchr ( const char *  data,
sizeB_t  n,
char  ch 
)
static

Bounded strchr() function.

Parameters
dataThe data pointer.
nThe maximum length to scan.
chThe character of interest.
Returns
The pointer to the located character, or NULL if it isn't found.

Definition at line 172 of file Utilities.cpp.

Referenced by RoutineClass::restore().

◆ strupper()

void Utilities::strupper ( char *  str)
static

Portable implementation of an ascii-z string to uppercase (in place).

Parameters
strString argument
Returns
The address of the str unput argument.

Definition at line 132 of file Utilities.cpp.

Referenced by hasNoBufferOption(), and LocalRegistrationManager::resolveCallback().

◆ traceConcurrency() [1/2]

◆ traceConcurrency() [2/2]

void Utilities::traceConcurrency ( bool  trace)
static

Definition at line 133 of file unix/SysUtilities.cpp.

References TRACE_CONCURRENCY.

◆ traceParsing() [1/2]

bool Utilities::traceParsing ( )
static

◆ traceParsing() [2/2]

void Utilities::traceParsing ( bool  trace)
static

Definition at line 165 of file unix/SysUtilities.cpp.

References TRACE_PARSING.

◆ vsnprintf()

int Utilities::vsnprintf ( char *  buffer,
size_t  count,
const char *  format,
va_list  args 
)
static

Encapsulation of vsnprintf Unix implementation. The goal is to have the same behavior on all platforms.

Parameters
bufferBuffer receiving the formated output.
sizeSize of buffer.
formatFormat string.
argsPointer to optional arguments
Returns
Upon successful completion, return the number of bytes stored in buffer, not counting the terminating null character or a negative value if an error was encountered.

Encapsulation of _vsnprintf Windows implementation. The goal is to have the same behavior on all platforms.

Parameters
bufferBuffer receiving the formated output.
sizeSize of buffer.
formatFormat string.
argsPointer to optional arguments
Returns
Upon successful completion, return the number of bytes stored in buffer, not counting the terminating null character or a negative value if an error was encountered.

Definition at line 60 of file unix/SysUtilities.cpp.

Referenced by rsnprintf(), and snprintf().


The documentation for this class was generated from the following files: