Crossfire Server  1.75.0
Utils.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2020-2021 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef UTILS_H
14 #define UTILS_H
15 
16 #include "global.h"
17 
18 class Utils {
19 public:
26  static bool endsWith(const char * const str, const char * const with);
27 
34  static void writeLinkedChar(const linked_char *list, StringBuffer *buf);
35 
42  static void writeStringArray(char **items, size_t count, StringBuffer *buf);
43 };
44 
45 #endif /* UTILS_H */
46 
static bool endsWith(const char *const str, const char *const with)
Checks if a string ends with another one.
Definition: Utils.cpp:16
Global type definitions and header inclusions.
static void writeStringArray(char **items, size_t count, StringBuffer *buf)
Write a list of strings as &#39; a,b,c&#39; (leading space).
Definition: Utils.cpp:36
Definition: Utils.h:18
StringBuffer * buf
Definition: readable.cpp:1563
A buffer that will be expanded as content is added to it.
static void writeLinkedChar(const linked_char *list, StringBuffer *buf)
Write a list of strings as &#39; a,b,c&#39; (leading space).
Definition: Utils.cpp:22