y2string.cc File Reference

#include <errno.h>
#include "y2log.h"
#include "y2string.h"

Functions

template<class In , class Out >
bool recode_all (iconv_t cd, const In &in, Out *out, const typename Out::value_type errorsign)
bool recode (iconv_t cd, const std::string &in, std::string *out)
bool recode (iconv_t cd, const std::string &in, std::wstring *out)
bool recode (iconv_t cd, const std::wstring &in, std::string *out)
bool recode (iconv_t cd, const std::wstring &in, std::wstring *out)
bool utf82wchar (const std::string &in, std::wstring *out)
bool wchar2utf8 (const std::wstring &in, std::string *out)

Function Documentation

bool recode ( iconv_t  cd,
const std::wstring &  in,
std::wstring *  out 
)

References recode_all().

bool recode ( iconv_t  cd,
const std::wstring &  in,
std::string *  out 
)

References recode_all().

bool recode ( iconv_t  cd,
const std::string &  in,
std::wstring *  out 
)

References recode_all().

bool recode ( iconv_t  cd,
const std::string &  in,
std::string *  out 
)

References recode_all().

Referenced by utf82wchar(), and wchar2utf8().

template<class In , class Out >
bool recode_all ( iconv_t  cd,
const In &  in,
Out *  out,
const typename Out::value_type  errorsign 
) [inline]

Referenced by recode().

bool utf82wchar ( const std::string &  in,
std::wstring *  out 
)

Convert a UTF-8 encoded string into a wide character string. Illegal input sequences are replaces by question marks.

Return false if no conversion was possible due to some general error. It does not return false if the input only contains illegal sequences.

The special feature of this function is that it does not depend on the current locale.

References recode(), and y2error.

Referenced by YCPStringRep::compare(), s_lsubstring1(), s_lsubstring2(), and s_size().

bool wchar2utf8 ( const std::wstring &  in,
std::string *  out 
)

Convert a wide character string into a UTF-8 encoded string. Illegal input sequences are replaces by question marks.

Return false if no conversion was possible due to some general error. It does not return false if the input only contains illegal sequences.

The special feature of this function is that it does not depend on the current locale.

References recode(), and y2error.

Referenced by s_lsubstring1(), and s_lsubstring2().


Generated on a sunny day for yast2-core by doxygen 1.6.3