String.cc File Reference

#include <cstdio>
#include <cstdarg>
#include <iostream>
#include "zypp/base/String.h"
Include dependency graph for String.cc:

Go to the source code of this file.

Namespaces

namespace  zypp
 

Easy-to use interface to the ZYPP dependency resolver.


namespace  zypp::str
 

String related utilities and Regular expressions.


Functions

std::string zypp::str::form (const char *format,...) __attribute__((format(printf
 Printf style construction of std::string.
std::string zypp::str::strerror (int errno_r)
 Return string describing the error_r code.
std::string zypp::str::stripFirstWord (std::string &line, const bool ltrim_first)
std::string zypp::str::stripLastWord (std::string &line, const bool rtrim_first)
string zypp::str::gsub (const string &sData, const string &sFrom, const string &sTo)
string & zypp::str::replaceAll (string &str, const string &from, const string &to)
static std::string zypp::str::_getline (std::istream &str, const Trim trim_r)
std::string zypp::str::getline (std::istream &str, const Trim trim_r)
std::string zypp::str::getline (std::istream &str, bool trim)

bool zypp::str::strToTrue (const C_Str &str)
 Parsing boolean from string.
bool zypp::str::strToFalse (const C_Str &str)
 Return false if str is 0, false, no, off.
Hexencode.

Encode all characters other than [a-zA-Z0-9] as XX.

Todo:
unsecape()

This includes the % character itself, which becomes 25.

std::string zypp::str::hexencode (const C_Str &str_r)
 Encode all characters other than [a-zA-Z0-9] as XX.
std::string zypp::str::hexdecode (const C_Str &str_r)
 Decode hexencoded XX sequences.
Case conversion.

std::string zypp::str::toLower (const std::string &s)
 Return lowercase version of s.
std::string zypp::str::toUpper (const std::string &s)
 Return uppercase version of s.
Trimming whitepace.

Todo:
optimize l/r trim.
std::string zypp::str::trim (const std::string &s, const Trim trim_r)
Join.

std::string zypp::str::escape (const C_Str &str_r, const char c= ' ')
 Escape desired character c using a backslash.

Detailed Description

Definition in file String.cc.

Generated on Fri Mar 2 09:45:56 2012 for libzypp by  doxygen 1.6.3