Crossfire Server, Trunk
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)
 
static void writeLinkedChar (const linked_char *list, StringBuffer *buf)
 
static void writeStringArray (char **items, size_t count, StringBuffer *buf)
 

Detailed Description

Definition at line 20 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.

References make_face_from_files::str.

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 disinfect::a, buf, guildoracle::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, disinfect::count, 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: