Crossfire Server  1.75.0
Utils Class Reference

#include <Utils.h>

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().

◆ 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 linked_char::name, linked_char::next, and stringbuffer_append_printf().

Referenced by writeRecipe().

◆ 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 stringbuffer_append_printf().

Referenced by writeRecipe().


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