Crossfire Server, Trunk  1.75.0
Utils Class Reference

#include <Utils.h>

+ Collaboration diagram for Utils:

Static Public Member Functions

static bool endsWith (const char *const str, const char *const with)
 Checks if a string ends with another one. More...
 
static void writeLinkedChar (const linked_char *list, StringBuffer *buf)
 Write a list of strings as ' a,b,c' (leading space). More...
 
static void writeStringArray (char **items, size_t count, StringBuffer *buf)
 Write a list of strings as ' a,b,c' (leading space). More...
 

Detailed Description

Definition at line 18 of file Utils.h.

Member Function Documentation

◆ endsWith()

bool Utils::endsWith ( const char *const  str,
const char *const  with 
)
static

Checks if a string ends with another one.

Parameters
strstring to check the end of.
withstring to check at the end of str.
Returns
true if 'str' ends with 'with', false else.

Definition at line 16 of file Utils.cpp.

Referenced by TarLoader::willLoad(), ArtifactLoader::willLoad(), FacesetLoader::willLoad(), ArchetypeLoader::willLoad(), MessageLoader::willLoad(), PngLoader::willLoad(), FaceLoader::willLoad(), TreasureLoader::willLoad(), QuestLoader::willLoad(), and WrapperLoader::willLoad().

+ Here is the caller graph for this function:

◆ writeLinkedChar()

void Utils::writeLinkedChar ( const linked_char list,
StringBuffer buf 
)
static

Write a list of strings as ' a,b,c' (leading space).

The items are inserted last-to-first, because loading inverts their order.

Parameters
listitems to write.
bufwhere to write.

Definition at line 22 of file Utils.cpp.

References a(), buf, list, and stringbuffer_append_printf().

Referenced by writeRecipe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeStringArray()

void Utils::writeStringArray ( char **  items,
size_t  count,
StringBuffer buf 
)
static

Write a list of strings as ' a,b,c' (leading space).

Parameters
itemsitems to write.
countnumber of items.
bufwhere to write.

Definition at line 36 of file Utils.cpp.

References buf, and stringbuffer_append_printf().

Referenced by writeRecipe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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