Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Macros | Typedefs | Functions
string_util.h File Reference
#include <cctype>
#include <cstddef>
#include <map>
#include <set>
#include <vector>
#include "base/logging.h"
#include "pagespeed/kernel/base/basictypes.h"
#include "pagespeed/kernel/base/string.h"
#include <cstdlib>
#include <string>
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"

Go to the source code of this file.

Classes

struct  net_instaweb::CharStarCompareInsensitive
 
struct  net_instaweb::CharStarCompareSensitive
 
struct  net_instaweb::StringCompareSensitive
 
struct  net_instaweb::StringCompareInsensitive
 

Namespaces

 net_instaweb
 Unit-test framework for wget fetcher.
 

Macros

#define STATIC_STRLEN(static_string)   (arraysize(static_string) - 1)
 

Typedefs

typedef StringPiece::size_type stringpiece_ssize_type
 
typedef std::map< GoogleString,
GoogleString
net_instaweb::StringStringMap
 
typedef std::map< GoogleString,
int > 
net_instaweb::StringIntMap
 
typedef std::set< GoogleStringnet_instaweb::StringSet
 
typedef std::set< GoogleString,
StringCompareInsensitive > 
net_instaweb::StringSetInsensitive
 
typedef std::vector< GoogleStringnet_instaweb::StringVector
 
typedef std::vector< StringPiece > net_instaweb::StringPieceVector
 
typedef std::vector< const
GoogleString * > 
net_instaweb::ConstStringStarVector
 
typedef std::vector
< GoogleString * > 
net_instaweb::StringStarVector
 
typedef std::vector< const char * > net_instaweb::CharStarVector
 

Functions

bool strings::StartsWith (StringPiece a, StringPiece b)
 
bool strings::EndsWith (StringPiece a, StringPiece b)
 
GoogleString net_instaweb::IntegerToString (int i)
 
GoogleString net_instaweb::UintToString (unsigned int i)
 
GoogleString net_instaweb::Integer64ToString (int64 i)
 
GoogleString net_instaweb::PointerToString (void *pointer)
 
bool net_instaweb::StringToInt (const char *in, int *out)
 
bool net_instaweb::StringToInt64 (const char *in, int64 *out)
 
bool net_instaweb::StringToInt (const GoogleString &in, int *out)
 
bool net_instaweb::StringToInt64 (const GoogleString &in, int64 *out)
 
bool net_instaweb::StringToDouble (const char *in, double *out)
 
bool net_instaweb::StringToDouble (GoogleString in, double *out)
 
bool net_instaweb::StringToDouble (StringPiece in, double *out)
 
StringPiece net_instaweb::PieceAfterEquals (StringPiece piece)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i)
 namescape internal More...
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v, StringPiece w)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v, StringPiece w, StringPiece x)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v, StringPiece w, StringPiece x, StringPiece y)
 
GoogleString net_instaweb::StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v, StringPiece w, StringPiece x, StringPiece y, StringPiece z)
 
GoogleString net_instaweb::internal::StrCatNineOrMore (const StringPiece *a1,...)
 Do not call directly - this is not part of the public API.
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a)
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a, StringPiece b)
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c)
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d)
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e)
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f)
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g)
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h)
 
void net_instaweb::StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i)
 
void net_instaweb::SplitStringPieceToVector (StringPiece sp, StringPiece separators, StringPieceVector *components, bool omit_empty_strings)
 
void net_instaweb::SplitStringUsingSubstr (StringPiece full, StringPiece substr, StringPieceVector *result)
 
void net_instaweb::BackslashEscape (StringPiece src, StringPiece to_escape, GoogleString *dest)
 
GoogleString net_instaweb::CEscape (StringPiece src)
 
bool net_instaweb::HasPrefixString (StringPiece str, StringPiece prefix)
 
void net_instaweb::UpperString (GoogleString *str)
 
void net_instaweb::LowerString (GoogleString *str)
 
bool net_instaweb::OnlyWhitespace (const GoogleString &str)
 
int net_instaweb::GlobalReplaceSubstring (StringPiece substring, StringPiece replacement, GoogleString *s)
 
stringpiece_ssize_type net_instaweb::FindIgnoreCase (StringPiece haystack, StringPiece needle)
 
int net_instaweb::GlobalEraseBracketedSubstring (StringPiece left, StringPiece right, GoogleString *string)
 
GoogleString net_instaweb::JoinStringStar (const ConstStringStarVector &vector, StringPiece delim)
 
char net_instaweb::UpperChar (char c)
 
char net_instaweb::LowerChar (char c)
 
char net_instaweb::IsHtmlSpace (char c)
 
char * net_instaweb::strdup (const char *str)
 
int net_instaweb::StringCaseCompare (StringPiece s1, StringPiece s2)
 Case-insensitive string comparison that is locale-independent.
 
bool net_instaweb::IsAsciiAlphaNumeric (char ch)
 
bool net_instaweb::IsHexDigit (char c)
 Convenience functions.
 
bool net_instaweb::IsDecimalDigit (char c)
 
bool net_instaweb::TrimWhitespace (StringPiece *str)
 
void net_instaweb::TrimQuote (StringPiece *str)
 In-place removal of leading and trailing quote. Removes whitespace as well.
 
void net_instaweb::TrimUrlQuotes (StringPiece *str)
 
bool net_instaweb::TrimLeadingWhitespace (StringPiece *str)
 Trims leading HTML whitespace. Returns true if any whitespace was trimmed.
 
bool net_instaweb::TrimTrailingWhitespace (StringPiece *str)
 Trims trailing HTML whitespace. Returns true if any whitespace was trimmed.
 
void net_instaweb::TrimWhitespace (StringPiece in, GoogleString *output)
 
bool net_instaweb::AccumulateDecimalValue (char c, uint32 *value)
 
bool net_instaweb::AccumulateHexValue (char c, uint32 *value)
 
bool net_instaweb::MemCaseEqual (const char *s1, size_t size1, const char *s2, size_t size2)
 Return true iff the two strings are equal, ignoring case.
 
bool net_instaweb::StringCaseEqual (StringPiece s1, StringPiece s2)
 
bool net_instaweb::StringCaseStartsWith (StringPiece str, StringPiece prefix)
 Return true iff str starts with prefix, ignoring case.
 
bool net_instaweb::StringCaseEndsWith (StringPiece str, StringPiece suffix)
 Return true iff str ends with suffix, ignoring case.
 
bool net_instaweb::StringEqualConcat (StringPiece str, StringPiece first, StringPiece second)
 
int net_instaweb::CountCharacterMismatches (StringPiece s1, StringPiece s2)
 
bool net_instaweb::SplitStringPieceToIntegerVector (StringPiece src, StringPiece separators, std::vector< int > *ints)
 
bool net_instaweb::EndsInSlash (StringPiece path)
 Does a path end in slash?
 
void net_instaweb::EnsureEndsInSlash (GoogleString *dir)
 Make sure directory's path ends in '/'.
 
void net_instaweb::ParseShellLikeString (StringPiece input, std::vector< GoogleString > *output)
 
int net_instaweb::CountSubstring (StringPiece text, StringPiece substring)
 
GoogleStringnet_instaweb::StringVectorAdd (StringVector *v)
 Appends new empty string to a StringVector and returns a pointer to it.
 
template<typename I >
void net_instaweb::AppendJoinIterator (GoogleString *dest, I start, I end, StringPiece sep)
 Append string-like objects accessed through an iterator. More...
 
template<typename C >
void net_instaweb::AppendJoinCollection (GoogleString *dest, const C &collection, StringPiece sep)
 
template<typename C >
GoogleString net_instaweb::JoinCollection (const C &collection, StringPiece sep)
 
const char * net_instaweb::BoolToString (bool b)
 Converts a boolean to string.
 
bool net_instaweb::IsAscii (char c)
 Using isascii with signed chars is unfortunately undefined.
 
bool net_instaweb::IsNonControlAscii (char c)
 

Macro Definition Documentation

#define STATIC_STRLEN (   static_string)    (arraysize(static_string) - 1)

Quick macro to get the size of a static char[] without trailing '\0'. Note: Cannot be used for char*, std::string, etc.