ut_std_string.h File Reference

#include <string>
#include <vector>
#include "ut_types.h"

Go to the source code of this file.


ABI_EXPORT std::string UT_escapeXML (const std::string &)
 replacement for UT_UTF8String::escapeXML escapes '<', '>', '"' and '&' in the current string
ABI_EXPORT std::string & UT_std_string_vprintf (std::string &inStr, const char *format, va_list args1) ABI_PRINTF_FORMAT(2
ABI_EXPORT std::string
&ABI_EXPORT std::string 
UT_std_string_sprintf (const char *inFormat,...) ABI_PRINTF_FORMAT(1
ABI_EXPORT std::string
&ABI_EXPORT std::string
ABI_EXPORT std::string 
UT_std_string_unicode (const UT_UCS4Char *unicode, UT_uint32 len)
 Create a string form a Unicode stream.
ABI_EXPORT bool starts_with (const std::string &fullstring, const std::string &prefix)
 true if fullstring starts with exactly prefix.
ABI_EXPORT bool ends_with (const std::string &fullstring, const std::string &ending)
ABI_EXPORT std::string replace_all (const std::string &s, char oldc, char newc)
ABI_EXPORT std::string replace_all (const std::string &s, const std::string &olds, const std::string &news)
ABI_EXPORT std::string UT_XML_cloneNoAmpersands (const std::string &szSource)
ABI_EXPORT std::vector
< std::string > 
UT_simpleSplit (const std::string &str, char separator= ' ')
ABI_EXPORT std::string UT_std_string_getPropVal (const std::string &sPropertyString, const std::string &sProp)
ABI_EXPORT void UT_std_string_removeProperty (std::string &sPropertyString, const std::string &sProp)
ABI_EXPORT void UT_std_string_setProperty (std::string &sPropertyString, const std::string &sProp, const std::string &sVal)
ABI_EXPORT void UT_std_string_addPropertyString (std::string &sPropertyString, const std::string &sNewProp)
ABI_EXPORT const std::string StreamToString (std::istream &iss)
ABI_EXPORT std::string toTimeString (time_t TT)
ABI_EXPORT time_t toTime (struct tm *tm)
ABI_EXPORT time_t parseTimeString (const std::string &stddatestr)

Function Documentation

ABI_EXPORT bool ends_with ( const std::string &  fullstring,
const std::string &  ending 
ABI_EXPORT time_t parseTimeString ( const std::string &  stddatestr  ) 
ABI_EXPORT std::string replace_all ( const std::string &  s,
const std::string &  olds,
const std::string &  news 
ABI_EXPORT std::string replace_all ( const std::string &  s,
char  oldc,
char  newc 
ABI_EXPORT bool starts_with ( const std::string &  fullstring,
const std::string &  prefix 
ABI_EXPORT const std::string StreamToString ( std::istream &  iss  ) 
ABI_EXPORT time_t toTime ( struct tm *  tm  ) 

Referenced by parseTimeString().

ABI_EXPORT std::string toTimeString ( time_t  TT  ) 
ABI_EXPORT std::string UT_escapeXML ( const std::string &   ) 
ABI_EXPORT std::vector<std::string> UT_simpleSplit ( const std::string &  str,
char  separator 

simplesplit splits the referring string along the character 'separator', removing the separator character, and placing the resulting strings in a vector.

Referenced by AbiTest_invoke(), EV_Menu::addMenuItem(), and TFTEST_MAIN().

ABI_EXPORT void UT_std_string_addPropertyString ( std::string &  sPropertyString,
const std::string &  sNewProp 

Assuming a string of standard abiword properties eg. "fred:nerk; table-width:1.0in;" Add aother propety string, updating previously defined properties with values in the new string.

References UT_std_string_setProperty().

Referenced by ie_imp_cell::addPropString(), TFTEST_MAIN(), and AP_Dialog_Styles::updateCurrentStyle().

ABI_EXPORT std::string UT_std_string_getPropVal ( const std::string &  sPropertyString,
const std::string &  sProp 

Some functions to add/subtract and extract std::string properties from a std::string of properties.

Assuming a string of standard abiword properties eg. "fred:nerk; table-width:1.0in;" Return the value of the property sProp or NULL if it is not present.


Referenced by ODi_TextContent_ListenerState::_openAbiSection(), ie_imp_table::getPropVal(), ie_imp_cell::getPropVal(), IE_Imp_RTF::HandleAbiCell(), IE_Imp_RTF::HandleAbiMathml(), IE_Imp_RTF::HandleAbiTable(), and TFTEST_MAIN().

ABI_EXPORT void UT_std_string_removeProperty ( std::string &  sPropertyString,
const std::string &  sProp 

Assuming a string of standard abiword properties eg. "fred:nerk; table-width:1.0in;" Remove the property sProp and it's value from the string of properties.

Referenced by IE_Imp_RTF::HandleAbiMathml(), IE_Imp_RTF::HandleAbiTable(), TFTEST_MAIN(), and UT_std_string_setProperty().

ABI_EXPORT void UT_std_string_setProperty ( std::string &  sPropertyString,
const std::string &  sProp,
const std::string &  sVal 

Assuming a string of standard abiword properties eg. "fred:nerk; table-width:1.0in;" Add the property sProp with value sVal to the string of properties. If the property is already present, replace the old value with the new value.

References UT_std_string_removeProperty().

Referenced by IE_Imp_RTF::_setStringProperty(), IE_Imp_RTF::addFrame(), IE_Imp_XHTML::appendFmt(), IE_Imp_RTF::closePastedTableIfNeeded(), IE_Imp_RTF::FlushCellProps(), IE_Imp_RTF::HandleAbiCell(), CellHelper::setProp(), ie_imp_table::setProp(), ie_imp_cell::setProp(), ODi_TextContent_ListenerState::startElement(), TFTEST_MAIN(), AP_Dialog_Styles::updateCurrentStyle(), and UT_std_string_addPropertyString().

ABI_EXPORT std::string& ABI_EXPORT std::string UT_std_string_sprintf ( const char *  inFormat,
ABI_EXPORT std::string& ABI_EXPORT std::string ABI_EXPORT std::string UT_std_string_unicode ( const UT_UCS4Char unicode,
UT_uint32  len 

Create a string form a Unicode stream.

Will be UTF8 encoded.

unicode the Unicode UCS4 string. Can't be NULL
len the length of the Unicode UCS4 string. Must match the length.
the std::string. Empty string if an invalid parameter or error.

References abicollab::service::error(), gchar, s, and UT_DEBUGMSG.

Referenced by AbiTest_invoke(), and TFTEST_MAIN().

ABI_EXPORT std::string& UT_std_string_vprintf ( std::string &  inStr,
const char *  format,
va_list  args1 
ABI_EXPORT std::string UT_XML_cloneNoAmpersands ( const std::string &  szSource  )