Some simple functions for string operations. More...
#include <stdio.h>#include <stdlib.h>#include <learning/learn_debug.h>
Go to the source code of this file.
Classes | |
| struct | StringBuffer_ |
| The StringBuffer structure stores buffers of strings. More... | |
Typedefs | |
| typedef struct StringBuffer_ | StringBuffer |
| The StringBuffer structure stores buffers of strings. | |
Functions | |
| StringBuffer * | NewStringBuffer (int length) |
| Make a new stringbuffer. | |
| void | FreeStringBuffer (StringBuffer **s) |
| Given a pointer to a stringbuffer pointer, free it and clear it. | |
| StringBuffer * | SetStringBufferLength (StringBuffer *s, unsigned int l) |
| char * | strBaseName (char *filename) |
| Returns the name of a file without leading pathname. | |
| char * | strRemoveSuffix (char *filename, char c='.') |
| Returns a fresh copy of the name of a file without suffix. | |
| char * | strConcat (int n,...) |
Returns the concatenation n strings. | |
| void | message (const char *msg,...) |
| Prints a message. | |
| StringBuffer * | read_string (FILE *f, StringBuffer *s) |
| Reads a string dynamically. | |
| char * | string_copy (char *c) |
| copies a string | |
Some simple functions for string operations.
Definition in file string_utils.h.
| typedef struct StringBuffer_ StringBuffer |
The StringBuffer structure stores buffers of strings.
|
extern |
Given a pointer to a stringbuffer pointer, free it and clear it.
Definition at line 156 of file string_utils.cpp.
|
extern |
Prints a message.
Definition at line 78 of file string_utils.cpp.
|
extern |
Make a new stringbuffer.
Definition at line 143 of file string_utils.cpp.

|
extern |
Reads a string dynamically.
Definition at line 93 of file string_utils.cpp.

|
extern |
|
extern |
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.
|
extern |
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.
|
extern |
copies a string
Definition at line 165 of file string_utils.cpp.
|
extern |
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.