10#ifndef __STRING_UTILS_H
11#define __STRING_UTILS_H
26#include "stringcase.h"
27#include "whitespace.h"
30bool printable (
const std::string& s);
33std::string basename (
const std::string& filename);
35std::string pathname (
const std::string& filename);
37std::string replace_extension (
const std::string& filename,
38 const std::string& extension);
41std::string time_string (
double seconds);
43std::vector<std::string>
44stringdecimate(
const std::string& wordstr, std::string delimiters);
47std::string remove_all (std::string input,
char c);
54stringload (std::string* str, std::istream &istr, std::streamsize nbytes=0);
61stringload (std::string* str, FILE* fptr,
size_t nbytes=0);
66void copy (FILE* from, FILE* to, ssize_t nbytes=-1);
72int stringfload (std::vector<std::string>* lines,
const std::string& filename);
73int stringload (std::vector<std::string>* lines, FILE* fptr);
79void loadlines (
const std::string& filename, std::vector<std::string>& lines);
84std::string stringprintf (
const char *fmt ...);
92void string_split( std::string source, std::string &before, std::string &after, std::string delimiter );
100void string_split_on_any ( std::string source, std::string &before, std::string &after, std::string delim_chars );
103void string_split_on_any (
const std::string& source, std::vector<std::string>& result, std::string delim_chars );