#include <learning/string_utils.h>#include <stdarg.h>#include <stdlib.h>#include <stdio.h>#include <portability.h>
Go to the source code of this file.
Macros | |
| #define | INIT_MSG_LEN 100 |
Functions | |
| char * | strBaseName (char *filename) |
| Returns the name of a file without leading pathname. More... | |
| char * | strRemoveSuffix (char *filename, char c) |
| Returns a fresh copy of the name of a file without suffix. More... | |
| char * | strConcat (int n,...) |
Returns the concatenation n strings. More... | |
| void | message (const char *msg,...) |
| Prints a message. More... | |
| StringBuffer * | read_string (FILE *f, StringBuffer *s) |
| Reads a string dynamically. More... | |
| StringBuffer * | SetStringBufferLength (StringBuffer *s, unsigned int l) |
| StringBuffer * | NewStringBuffer (int length) |
| Make a new stringbuffer. More... | |
| void | FreeStringBuffer (StringBuffer **s) |
| Given a pointer to a stringbuffer pointer, free it and clear it. More... | |
| char * | string_copy (char *c) |
| copies a string More... | |
Variables | |
| static char | msgbuf [10000] |
| static FILE * | msgport = stderr |
| #define INIT_MSG_LEN 100 |
Definition at line 87 of file string_utils.cpp.
| void FreeStringBuffer | ( | StringBuffer ** | s | ) |
Given a pointer to a stringbuffer pointer, free it and clear it.
Definition at line 156 of file string_utils.cpp.
| void message | ( | const char * | msg, |
| ... | |||
| ) |
Prints a message.
Definition at line 78 of file string_utils.cpp.
| StringBuffer* NewStringBuffer | ( | int | length | ) |
Make a new stringbuffer.
Definition at line 143 of file string_utils.cpp.

| StringBuffer* read_string | ( | FILE * | f, |
| StringBuffer * | s | ||
| ) |
Reads a string dynamically.
Definition at line 93 of file string_utils.cpp.

| StringBuffer* SetStringBufferLength | ( | StringBuffer * | s, |
| unsigned int | l | ||
| ) |
| char* strBaseName | ( | char * | filename | ) |
Returns the name of a file without leading pathname.
(It's not a new string, but a pointer in the given string)
Definition at line 25 of file string_utils.cpp.
| char* strConcat | ( | int | n, |
| ... | |||
| ) |
Returns the concatenation n strings.
The strings are the parameters given after n You have to free the memory!
Definition at line 49 of file string_utils.cpp.
| char* string_copy | ( | char * | c | ) |
copies a string
Definition at line 165 of file string_utils.cpp.
| char* strRemoveSuffix | ( | char * | filename, |
| char | c = '.' |
||
| ) |
Returns a fresh copy of the name of a file without suffix.
(Trailing chars after c) You have to free the memory!
Definition at line 30 of file string_utils.cpp.
|
static |
Definition at line 22 of file string_utils.cpp.
|
static |
Definition at line 23 of file string_utils.cpp.