Functions

ut_std_string.cpp File Reference

#include <string.h>
#include "ut_assert.h"
#include "ut_std_string.h"
#include "ut_string.h"
#include <iostream>
#include <sstream>
#include <list>

Functions

std::string UT_escapeXML (const std::string &s)
 replacement for UT_UTF8String::escapeXML escapes '<', '>', '"' and '&' in the current string
std::string & UT_std_string_vprintf (std::string &inStr, const char *format, va_list args1)
std::string UT_std_string_sprintf (const char *inFormat,...)
bool ends_with (const std::string &s, const std::string &ending)
bool starts_with (const std::string &s, const std::string &starting)
 true if fullstring starts with exactly prefix.
std::string replace_all (const std::string &s, char oldc, char newc)
std::string replace_all (const std::string &s, const std::string &olds, const std::string &news)
std::string UT_XML_cloneNoAmpersands (const std::string &src)
std::string UT_std_string_getPropVal (const std::string &sPropertyString, const std::string &sProp)
void UT_std_string_setProperty (std::string &sPropertyString, const std::string &sProp, const std::string &sVal)
void UT_std_string_removeProperty (std::string &sPropertyString, const std::string &sProp)
const std::string StreamToString (std::istream &iss)
std::string toTimeString (time_t TT)
time_t toTime (struct tm *tm)
time_t parseTimeString (const std::string &stddatestr)

Function Documentation

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

Referenced by parseTimeString().

std::string toTimeString ( time_t  TT  ) 
std::string UT_escapeXML ( const std::string &  s  ) 
std::string UT_std_string_getPropVal ( const std::string &  sPropertyString,
const std::string &  sProp 
)

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

References UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.

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

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; table-height:10.in" 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().

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; table-height:10.in" 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_RTF::closePastedTableIfNeeded(), IE_Imp_RTF::FlushCellProps(), IE_Imp_RTF::HandleAbiCell(), ODi_TextContent_ListenerState::startElement(), and TFTEST_MAIN().

std::string UT_std_string_sprintf ( const char *  inFormat,
  ... 
)

References UT_std_string_vprintf().

Referenced by IE_Imp_RTF::_appendHdrFtr(), PD_Document::_buildAuthorProps(), ODi_Style_PageLayout::_buildSectionPropsString(), _convertBorderThickness(), ODi_TextContent_ListenerState::_defineAbiTOCHeadingStyles(), GR_CairoGraphics::_findFont(), IE_Imp_RTF::_formRevisionAttr(), AP_Dialog_Border_Shading::_getToggleButtonStatus(), s_KWord_1_Listener::_handleDataItems(), s_AbiWord_1_Listener::_handleRevisions(), ODi_TextContent_ListenerState::_insertAnnotation(), IE_Exp_RTF::_output_LevelText(), ODi_Style_Style::_parse_style_paragraphProperties(), ODi_Style_Style::_parse_style_sectionProperties(), ODi_Style_Style::_parse_style_textProperties(), ODi_Table_ListenerState::_parseCellStart(), ODi_Numbered_ListLevelStyle::_setAbiListType(), PD_Document::addAuthorAttributeIfBlank(), IE_Imp_RTF::addFrame(), OXML_Element_Math::addToPT(), IE_Imp_RTF::ApplyParagraphAttributes(), IE_Imp_RTF::ApplySectionAttributes(), PD_Document::areDocumentStylesheetsEqual(), AP_Dialog_FormatFrame::askForGraphicPathName(), RTF_msword97_level::buildAbiListProperties(), ODi_Style_Style::buildAbiPropsAttrString(), IE_Imp_RTF::buildAllProps(), IE_Imp_RTF::buildCharacterProps(), buildTemplateList(), fp_FieldPageReferenceRun::calculateValue(), IE_Imp_RTF::closePastedTableIfNeeded(), IE_Imp_DocBook::createImage(), GR_CairoRasterImage::createImageSegment(), ODi_Style_PageLayout::definePageSizeTag(), Defun_EV_GetToolbarItemState_Fn(), IE_Imp_RTF::EndAnnotation(), ODi_TextContent_ListenerState::endElement(), ODi_Frame_ListenerState::endElement(), ODe_ManifestWriter::ensureDirectoryManifest(), IE_Exp_EPUB::EPUB2_writeNavigation(), IE_Exp_EPUB::EPUB2_writeStructure(), IE_Exp_EPUB::EPUB3_writeNavigation(), AP_Dialog_RDFQuery::executeQuery(), GR_Graphics::findFont(), GR_Win32Font::GR_Win32Font(), IE_Imp_RTF::HandleAbiCell(), IE_Imp_RTF::HandleAbiEndTable(), IE_Imp_RTF::HandleAbiTable(), IE_Imp_RTF::HandleAnnotation(), IE_Imp_RTF::HandleNote(), IE_Imp_RTF::HandleNoteReference(), FV_View::insertAnnotation(), FV_View::insertFootnote(), IE_Imp_RTF::InsertImage(), localizeButtonMarkup(), localizeLabelMarkup(), UT_VersionInfo::makeVersString(), ODc_reorderDate(), ODi_Numbered_ListLevelStyle::ODi_Numbered_ListLevelStyle(), OO_PageStyle::parse(), GR_PangoFont::reloadFont(), XAP_UnixDialog_MessageBox::runModal(), FV_View::setAnnotationText(), XAP_UnixWidget::setLabelCStr(), setLabelMarkup(), AP_Win32Dialog_Stylist::setStyleInGUI(), XAP_UnixWidget::setValueFloat(), XAP_UnixWidget::setValueInt(), IE_Imp_RTF::StartAnnotation(), ODi_TextContent_ListenerState::startElement(), ODi_Bullet_ListLevelStyle::startElement(), AP_Dialog_RDFEditor::statusIsTripleCount(), IE_Imp_RTF::TranslateKeywordID(), ODe_ManifestWriter::writeManifest(), OO_ManifestWriter::writeManifest(), ODe_MetaDataWriter::writeMetaData(), OO_MetaDataWriter::writeMetaData(), and OO_PicturesWriter::writePictures().

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