1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/ |
---|
2 | // Copyright (C) 1999-2015 Maciej Komosinski and Szymon Ulatowski. |
---|
3 | // See LICENSE.txt for details. |
---|
4 | |
---|
5 | #ifndef _SSTRINGUTILS_H_ |
---|
6 | #define _SSTRINGUTILS_H_ |
---|
7 | |
---|
8 | #include "sstring.h" |
---|
9 | #include <common/virtfile/virtfile.h> |
---|
10 | |
---|
11 | /// return: 1=ok 0=error |
---|
12 | int loadSString(const char* filename, SString& s, const char* framsgmodule = 0, const char* error = 0); |
---|
13 | void loadSString(VirtFILE *f, SString& s); |
---|
14 | bool loadSStringLine(VirtFILE* f, SString &s); |
---|
15 | |
---|
16 | int quoteTilde(SString &target); |
---|
17 | int unquoteTilde(SString &target); |
---|
18 | |
---|
19 | bool strContainsOneOf(const char* str, const char* chars); |
---|
20 | bool sstringQuote(SString& target); |
---|
21 | const char* skipQuoteString(const char* txt, const char* limit); |
---|
22 | int sstringUnquote(SString &target); |
---|
23 | |
---|
24 | int strFindField(const SString& txt, const SString& name, int &end); |
---|
25 | SString strGetField(const SString& txt, const SString& name); |
---|
26 | void strSetField(SString& txt, const SString& name, const SString& value); |
---|
27 | |
---|
28 | SString trim(const SString& s); ///< remove leading/trailing whitespace |
---|
29 | bool removeCR(SString& s); ///< remove '\r' return true if changed |
---|
30 | bool matchWildcard(const SString& word, const SString& pattern);///< '*' in pattern matches any substring |
---|
31 | bool matchWildcardList(const SString& word, const SString& patterns);///< patterns is a list of patterns (separated by ',') |
---|
32 | |
---|
33 | #endif |
---|