/usr/include/bobcat/string is in libbobcat-dev 2.20.01-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #ifndef INCLUDED_BOBCAT_STRING_
#define INCLUDED_BOBCAT_STRING_
#include <strings.h>
#include <string>
#include <vector>
#include <cctype>
namespace FBB
{
class String
{
public:
enum Type
{
DQUOTE_UNTERMINATED, // unterminated d-quoted element
SQUOTE_UNTERMINATED, // unterminated s-quoted element
ESCAPED_END, // word with plain \ at the end
SEPARATOR, // separator encountered
NORMAL, // normal string-element in the original string
DQUOTE, // string-element originally surrounded by " chars
SQUOTE, // string-element originally surrounded by ' chars
};
typedef std::pair<std::string, Type> SplitPair;
typedef std::string::const_iterator const_iterator;
static char const **argv(std::vector<std::string> const &lines);
static int casecmp(std::string const &lhs, std::string const &rhs);
static std::string lc(std::string const &str);
static size_t split(std::vector<std::string> *words,
std::string const &str,
char const *separators = " \t",
bool addEmpty = false);
static size_t split(std::vector<SplitPair> *words,
std::string const &str,
char const *separators = " \t",
bool addEmpty = false);
static std::string trim(std::string const &str);
static std::string uc(std::string const &str);
static std::string unescape(std::string const &str);
static std::string escape(std::string const &str,
char const *series = "'\"\\");
private:
static Type nextField(std::string const &str,
const_iterator *until, const_iterator from,
std::string const &separators);
static const_iterator separator(std::string const &str,
const_iterator from,
std::string const &separators);
static const_iterator quoted(std::string const &str,
const_iterator from, int quote);
static Type word(std::string const &str,
const_iterator *until, const_iterator from,
std::string const &separators);
static void tolower(char &chr);
static void toupper(char &chr);
};
inline int String::casecmp(std::string const &lhs, std::string const &rhs)
{
return strcasecmp(lhs.c_str(), rhs.c_str());
}
} // FBB
#endif
|