Classes | Functions

ut_string_class.h File Reference

#include <stdlib.h>
#include <stdarg.h>
#include <string>
#include "ut_types.h"
#include "ut_string.h"
#include "ut_stringbuf.h"

Go to the source code of this file.

Classes

class  UT_String
class  UT_UTF8String
class  UT_UCS4String

Functions

ABI_EXPORT bool operator== (const UT_String &s1, const UT_String &s2)
ABI_EXPORT bool operator== (const UT_String &s1, const char *s2)
ABI_EXPORT bool operator== (const char *s1, const UT_String &s2)
ABI_EXPORT bool operator!= (const UT_String &s1, const UT_String &s2)
ABI_EXPORT bool operator!= (const UT_String &s1, const char *s2)
ABI_EXPORT bool operator!= (const char *s1, const UT_String &s2)
ABI_EXPORT UT_uint32 hashcode (const UT_String &string)
ABI_EXPORT UT_uint32 hashcode (const char *s)
ABI_EXPORT bool operator< (const UT_String &s1, const UT_String &s2)
ABI_EXPORT UT_String operator+ (const UT_String &s1, const UT_String &s2)
ABI_EXPORT size_t UT_String_findCh (const UT_String &st, char ch)
ABI_EXPORT size_t UT_String_findRCh (const UT_String &st, char ch)
ABI_EXPORT UT_StringUT_String_sprintf (UT_String &inStr, const char *inFormat,...) ABI_PRINTF_FORMAT(2
ABI_EXPORT UT_String
&ABI_EXPORT UT_String
UT_String_vprintf (UT_String &inStr, const char *format, va_list args1) ABI_PRINTF_FORMAT(2
ABI_EXPORT UT_String
&ABI_EXPORT UT_String
&ABI_EXPORT UT_String
UT_String_vprintf (UT_String &inStr, const UT_String &format, va_list args1)
ABI_EXPORT UT_String UT_String_sprintf (const char *inFormat,...) ABI_PRINTF_FORMAT(1
ABI_EXPORT UT_String
ABI_EXPORT UT_String 
UT_String_vprintf (const char *inFormat, va_list args1) ABI_PRINTF_FORMAT(1
ABI_EXPORT UT_String
ABI_EXPORT UT_String
ABI_EXPORT UT_String 
UT_String_vprintf (const UT_String &inFormat, va_list args1)
ABI_EXPORT UT_String UT_String_getPropVal (const UT_String &sPropertyString, const UT_String &sProp)
ABI_EXPORT void UT_String_removeProperty (UT_String &sPropertyString, const UT_String &sProp)
ABI_EXPORT void UT_String_setProperty (UT_String &sPropertyString, const UT_String &sProp, const UT_String &sVal)
ABI_EXPORT void UT_String_addPropertyString (UT_String &sPropertyString, const UT_String &sNewProp)
ABI_EXPORT bool operator< (const UT_UTF8String &s1, const UT_UTF8String &s2)
ABI_EXPORT bool operator== (const UT_UTF8String &s1, const UT_UTF8String &s2)
ABI_EXPORT bool operator!= (const UT_UTF8String &s1, const UT_UTF8String &s2)
ABI_EXPORT bool operator== (const UT_UTF8String &s1, const char *s2)
ABI_EXPORT bool operator!= (const UT_UTF8String &s1, const char *s2)
ABI_EXPORT bool operator== (const UT_UTF8String &s1, const std::string &s2)
ABI_EXPORT bool operator!= (const UT_UTF8String &s1, const std::string &s2)
ABI_EXPORT bool operator== (const std::string &s2, const UT_UTF8String &s1)
ABI_EXPORT bool operator!= (const std::string &s2, const UT_UTF8String &s1)
ABI_EXPORT UT_UTF8String operator+ (const UT_UTF8String &s1, const UT_UTF8String &s2)
ABI_EXPORT UT_UTF8String UT_UTF8String_sprintf (const char *inFormat,...)
ABI_EXPORT UT_UTF8StringUT_UTF8String_sprintf (UT_UTF8String &inStr, const char *inFormat,...)
ABI_EXPORT UT_UTF8String UT_UTF8String_getPropVal (const UT_UTF8String &sPropertyString, const UT_UTF8String &sProp)
ABI_EXPORT void UT_UTF8String_removeProperty (UT_UTF8String &sPropertyString, const UT_UTF8String &sProp)
ABI_EXPORT void UT_UTF8String_setProperty (UT_UTF8String &sPropertyString, const UT_UTF8String &sProp, const UT_UTF8String &sVal)
ABI_EXPORT void UT_UTF8String_addPropertyString (UT_UTF8String &sPropertyString, const UT_UTF8String &sNewProp)
ABI_EXPORT void UT_UTF8String_replaceString (UT_UTF8String &sString, const UT_UTF8String &sOldValue, const UT_UTF8String &sNewValue)
bool operator== (const UT_UCS4String &s1, const UT_UCS4String &s2)
bool operator== (const UT_UCS4String &s1, const UT_UCS4Char *s2)
bool operator== (const UT_UCS4Char *s1, const UT_UCS4String &s2)
bool operator!= (const UT_UCS4String &s1, const UT_UCS4String &s2)
bool operator!= (const UT_UCS4String &s1, const UT_UCS4Char *s2)
bool operator!= (const UT_UCS4Char *s1, const UT_UCS4String &s2)
bool operator< (const UT_UCS4String &s1, const UT_UCS4String &s2)
UT_UCS4String operator+ (const UT_UCS4String &s1, const UT_UCS4String &s2)

Function Documentation

ABI_EXPORT UT_uint32 hashcode ( const UT_String string  ) 

References hashcode().

Referenced by key_wrapper::compute_hash(), and hashcode().

ABI_EXPORT UT_uint32 hashcode ( const char *  s  ) 

References UT_return_val_if_fail.

ABI_EXPORT bool operator!= ( const UT_String s1,
const char *  s2 
)
bool operator!= ( const UT_UCS4String s1,
const UT_UCS4String s2 
)
bool operator!= ( const UT_UCS4String s1,
const UT_UCS4Char s2 
)
bool operator!= ( const UT_UCS4Char s1,
const UT_UCS4String s2 
)
ABI_EXPORT bool operator!= ( const UT_String s1,
const UT_String s2 
)
ABI_EXPORT bool operator!= ( const UT_UTF8String s1,
const UT_UTF8String s2 
)
ABI_EXPORT bool operator!= ( const UT_UTF8String s1,
const char *  s2 
)
ABI_EXPORT bool operator!= ( const char *  s1,
const UT_String s2 
)
ABI_EXPORT bool operator!= ( const UT_UTF8String s1,
const std::string &  s2 
)
ABI_EXPORT bool operator!= ( const std::string &  s2,
const UT_UTF8String s1 
)
ABI_EXPORT UT_UTF8String operator+ ( const UT_UTF8String s1,
const UT_UTF8String s2 
)

References s.

ABI_EXPORT UT_String operator+ ( const UT_String s1,
const UT_String s2 
)

References s.

UT_UCS4String operator+ ( const UT_UCS4String s1,
const UT_UCS4String s2 
)

References s.

bool operator< ( const UT_UCS4String s1,
const UT_UCS4String s2 
)
ABI_EXPORT bool operator< ( const UT_String s1,
const UT_String s2 
)

References UT_String::c_str().

ABI_EXPORT bool operator< ( const UT_UTF8String s1,
const UT_UTF8String s2 
)
bool operator== ( const UT_UCS4Char s1,
const UT_UCS4String s2 
)
ABI_EXPORT bool operator== ( const UT_String s1,
const char *  s2 
)

References UT_String::c_str().

bool operator== ( const UT_UCS4String s1,
const UT_UCS4String s2 
)
bool operator== ( const UT_UCS4String s1,
const UT_UCS4Char s2 
)
ABI_EXPORT bool operator== ( const UT_String s1,
const UT_String s2 
)
ABI_EXPORT bool operator== ( const char *  s1,
const UT_String s2 
)
ABI_EXPORT bool operator== ( const UT_UTF8String s1,
const UT_UTF8String s2 
)
ABI_EXPORT bool operator== ( const UT_UTF8String s1,
const char *  s2 
)
ABI_EXPORT bool operator== ( const UT_UTF8String s1,
const std::string &  s2 
)
ABI_EXPORT bool operator== ( const std::string &  s2,
const UT_UTF8String s1 
)
ABI_EXPORT void UT_String_addPropertyString ( UT_String sPropertyString,
const UT_String sNewProp 
)

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

References UT_String::c_str(), UT_String::size(), UT_String::substr(), and UT_String_setProperty().

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

ABI_EXPORT size_t UT_String_findCh ( const UT_String st,
char  ch 
)
ABI_EXPORT size_t UT_String_findRCh ( const UT_String st,
char  ch 
)

References UT_String::size().

ABI_EXPORT UT_String UT_String_getPropVal ( const UT_String sPropertyString,
const UT_String sProp 
)

Some functions to add/subtract and extract UT_String properties from a UT_String of properties.

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. This UT_String * should be deleted by the calling programming after it is finished with it.

References UT_String::c_str(), UT_String::substr(), UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.

Referenced by s_RTF_ListenerWriteDoc::_export_AbiWord_Cell_props(), s_RTF_ListenerWriteDoc::_getPropString(), IE_Imp_StarOffice::_loadFile(), ie_imp_table::getPropVal(), and ie_imp_cell::getPropVal().

ABI_EXPORT void UT_String_removeProperty ( UT_String sPropertyString,
const UT_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.

References UT_String::c_str(), UT_String::clear(), UT_String::size(), and UT_String::substr().

Referenced by IE_Imp_StarOffice::_loadFile(), TFTEST_MAIN(), and UT_String_setProperty().

ABI_EXPORT void UT_String_setProperty ( UT_String sPropertyString,
const UT_String sProp,
const UT_String sVal 
)
ABI_EXPORT UT_String UT_String_sprintf ( const char *  inFormat,
  ... 
)

Returns a new UT_String object with the results of evaluating the printf formatted string

ABI_EXPORT UT_String& UT_String_sprintf ( UT_String inStr,
const char *  inFormat,
  ... 
)

Fill with the results of evaulating the printf formatted string and return the reference to

ABI_EXPORT UT_String ABI_EXPORT UT_String UT_String_vprintf ( const char *  inFormat,
va_list  args1 
)
ABI_EXPORT UT_String& ABI_EXPORT UT_String& ABI_EXPORT UT_String& UT_String_vprintf ( UT_String inStr,
const UT_String format,
va_list  args1 
)
ABI_EXPORT UT_String& ABI_EXPORT UT_String& UT_String_vprintf ( UT_String inStr,
const char *  format,
va_list  args1 
)
ABI_EXPORT UT_String ABI_EXPORT UT_String ABI_EXPORT UT_String UT_String_vprintf ( const UT_String inFormat,
va_list  args1 
)

References UT_String_vprintf().

ABI_EXPORT void UT_UTF8String_addPropertyString ( UT_UTF8String sPropertyString,
const UT_UTF8String sNewProp 
)

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

References UT_UTF8String::size(), UT_UTF8String::substr(), UT_UTF8String_setProperty(), and UT_UTF8String::utf8_str().

Referenced by FV_View::cmdInsertEmbed(), and FV_View::cmdUpdateEmbed().

ABI_EXPORT UT_UTF8String UT_UTF8String_getPropVal ( const UT_UTF8String sPropertyString,
const UT_UTF8String sProp 
)

Some functions to add/subtract and extract UT_String properties from a UT_String of properties.

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. This UT_UTF8String * should be deleted by the calling programming after it is finished with it.

References UT_UTF8String::substr(), UT_ASSERT, UT_SHOULD_NOT_HAPPEN, and UT_UTF8String::utf8_str().

Referenced by AP_Dialog_FormatTOC::getTOCPropVal(), and IE_Imp_RTF::HandleAbiEmbed().

ABI_EXPORT void UT_UTF8String_removeProperty ( UT_UTF8String sPropertyString,
const UT_UTF8String 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.

References UT_UTF8String::clear(), UT_UTF8String::size(), UT_UTF8String::substr(), and UT_UTF8String::utf8_str().

Referenced by IE_Imp_RTF::HandleAbiEmbed(), and UT_UTF8String_setProperty().

ABI_EXPORT void UT_UTF8String_replaceString ( UT_UTF8String sString,
const UT_UTF8String sOldValue,
const UT_UTF8String sNewValue 
)
ABI_EXPORT void UT_UTF8String_setProperty ( UT_UTF8String sPropertyString,
const UT_UTF8String sProp,
const UT_UTF8String 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_UTF8String::size(), and UT_UTF8String_removeProperty().

Referenced by s_RTF_ListenerWriteDoc::_openTag(), FL_DocLayout::AnchoredObjectHelper(), IE_Exp_DocRangeListener::assembleAtts(), FV_View::cmdInsertEmbed(), FV_View::cmdInsertLatexMath(), FV_View::cmdUpdateEmbed(), FL_DocLayout::loadPendingObjects(), AP_Dialog_FormatTOC::setTOCProperty(), and UT_UTF8String_addPropertyString().

ABI_EXPORT UT_UTF8String& UT_UTF8String_sprintf ( UT_UTF8String inStr,
const char *  inFormat,
  ... 
)
ABI_EXPORT UT_UTF8String UT_UTF8String_sprintf ( const char *  inFormat,
  ... 
)

References UT_String::c_str(), and UT_String_vprintf().

Referenced by ODe_AbiDocListener::_appendSpaces(), AbiCollab_Command::_doCmdDebug(), s_WML_Listener::_emitTOC(), s_XSL_FO_Listener::_getCellThicknesses(), s_XSL_FO_Listener::_getTableThicknesses(), TCPAccountHandler::_handleAccept(), s_XSL_FO_Listener::_handleDataItems(), s_WML_Listener::_handleDataItems(), s_DocBook_Listener::_handleDataItems(), s_WML_Listener::_handleEmbedded(), s_AbiWord_1_Listener::_handleHistory(), s_WML_Listener::_handleImage(), s_DocBook_Listener::_handleImage(), s_XSL_FO_Listener::_handleMath(), s_DocBook_Listener::_handleMath(), s_XSL_FO_Listener::_handlePageSize(), s_DocBook_Listener::_handlePositionedImage(), s_DocBook_Listener::_handleRevisions(), ODe_Text_Listener::_initDefaultHeadingStyles(), ODe_AbiDocListener::_insertMath(), IE_Exp_HTML_Listener::_insertMath(), IE_Imp_MsWord_97::_insertTOC(), IE_Exp_HTML_Listener::_insertTOC(), IE_Exp_HTML_Listener::_makeStylesheet(), Passepartout_Listener::_openBlock(), OO_Listener::_openBlock(), s_XSL_FO_Listener::_openCell(), IE_Exp_HTML_Listener::_openCell(), s_DocBook_Listener::_openCell(), Passepartout_Listener::_openFont(), IE_Exp_HTML_Listener::_openHeading(), s_DocBook_Listener::_openNestedTable(), ODe_Note_Listener::_openNote(), ODe_Frame_Listener::_openODTextbox(), s_WML_Listener::_openParagraph(), ODe_Text_Listener::_openParagraphDelayed(), s_WML_Listener::_openSection(), s_WML_Listener::_openTable(), IE_Exp_HTML_Listener::_openTable(), s_DocBook_Listener::_openTable(), s_AbiWord_1_Listener::_openTag(), AccountHandler::_reportProtocolError(), ODe_AutomaticStyles::_storeStyle(), fp_MathRun::_updatePropValuesIfNeeded(), fp_EmbedRun::_updatePropValuesIfNeeded(), XAP_FrameImpl::_updateTitle(), IE_Exp_RTF::_write_rtf_header(), ODe_ListLevelStyle::_writeListLevelProperties(), s_RTF_ListenerWriteDoc::_writeSPNumProp(), ODe_ListLevelStyle::_writeTextProperties(), abi_widget_set_current_page(), AbiMathView_FileInsert(), ODe_FontFaceDecls::addFont(), OO_StylesWriter::addFontDecls(), ODe_AutomaticStyles::addListStyle(), ODe_AutomaticStyles::addPageLayout(), AD_Document::addRevision(), ap_sbf_PageInfo::ap_sbf_PageInfo(), AP_Dialog_Lists::Apply(), IE_Imp_Psion::applyPageAttributes(), XMPPAccountHandler::authenticate(), ODe_ListLevelStyle::calculateListMargins(), fp_FieldPageCountRun::calculateValue(), fp_FieldPageReferenceRun::calculateValue(), fp_FieldPageNumberRun::calculateValue(), fp_FieldTimeEpochRun::calculateValue(), fp_FieldWordCountRun::calculateValue(), fp_FieldParaCountRun::calculateValue(), fp_FieldLineCountRun::calculateValue(), fp_FieldNonBlankCharCountRun::calculateValue(), fp_FieldCharCountRun::calculateValue(), AbiCollabSessionManager::closeSession(), XMPPAccountHandler::connect(), IE_Imp_XSL_FO::createImage(), IE_Imp_WML::createImage(), IE_Imp_DocBook::createTitle(), IE_Imp_XHTML::endElement(), AP_UnixDialog_FormatTable::event_BorderThicknessChanged(), AP_UnixDialog_FormatFrame::event_BorderThicknessChanged(), AP_UnixDialog_Border_Shading::event_BorderThicknessChanged(), AP_CocoaDialog_FormatTable::event_BorderThicknessChanged, AP_UnixDialog_Border_Shading::event_ShadingOffsetChanged(), ODe_Style_PageLayout::fetchAttributesFromAbiDoc(), ODe_Style_Style::TableProps::fetchAttributesFromAbiProps(), ODe_Style_Style::ParagraphProps::fetchAttributesFromAbiProps(), ODe_Style_PageLayout::fetchAttributesFromAbiSection(), Save_MailMerge_Listener::fireUpdate(), IE_Imp_Psion::getCharacterAttributes(), fl_TOCLayout::getDefaultDestStyle(), fl_TOCLayout::getDefaultSourceStyle(), XMPPAccountHandler::getDescription(), TCPAccountHandler::getDescription(), ODe_Style_List::getLevelStyle(), ListHelper::getNextLabel(), IE_Imp_Psion::getParagraphAttributes(), ServiceAccountHandler::getShareHint(), getStyleSizeString(), AP_Dialog_FormatTOC::getTOCPropVal(), IE_Imp_RTF::HandlePicture(), IE_Exp_HTML_StyleTree::IE_Exp_HTML_StyleTree(), AP_Dialog_FormatTOC::incrementIndent(), AP_Dialog_FormatTOC::incrementStartAt(), IE_Exp_HTML_DocumentWriter::insertAnnotations(), IE_Exp_EPUB_EPUB3Writer::insertAnnotations(), IE_Exp_HTML_DocumentWriter::insertEndnotes(), IE_Exp_EPUB_EPUB3Writer::insertEndnotes(), IE_Exp_HTML_DocumentWriter::insertFootnotes(), IE_Exp_EPUB_EPUB3Writer::insertFootnotes(), IE_Imp_Psion::insertImage(), ODe_Text_Listener::insertInlinedImage(), ODe_Text_Listener::insertPositionedImage(), ODe_Table_Cell::loadAbiProps(), OO_StylesWriter::map(), FV_VisualInlineImage::mouseCopy(), FV_VisualInlineImage::mouseRelease(), ap_sbf_PageInfo::notify(), TelepathyChatroom::offerTube(), ODe_Text_Listener::openAnnotation(), IE_Exp_HTML_DocumentWriter::openAnnotation(), IE_Exp_EPUB_EPUB3Writer::openAnnotation(), OO_WriterImpl::openBlock(), ODe_Table_Listener::openCell(), ODe_Text_Listener::openField(), IE_Exp_HTML_DocumentWriter::openField(), ODe_Main_Listener::openSection(), ODe_Text_Listener::openSpan(), OO_WriterImpl::openSpan(), ODe_Table_Listener::openTable(), ODe_Text_Listener::openTOC(), ODe_HeadingSearcher_Listener::openTOC(), Passepartout_Listener::Passepartout_Listener(), AP_CocoaApp::pasteFromClipboard(), fl_DocListener::populateStrux(), AbiCollabSessionManager::processPacket(), AbiCollabSessionManager::removeBuddy(), XAP_Win32Dialog_About::runModal(), s_back_color_changed(), s_doZoomDlg(), IE_Exp_RTF::s_escapeString(), s_fore_color_changed(), s_props_append(), SaveBindings_invoke(), XAP_Dialog_HTMLOptions::saveDefaults(), AbiCollabSessionManager::setDocumentHandles(), ODe_Style_List::setLevelStyle(), fp_FrameContainer::setPreferedColumnNo(), fp_FrameContainer::setPreferedPageNo(), XMPPAccountHandler::setup(), sFormatDouble(), IE_Imp_XSL_FO::startElement(), IE_Imp_DocBook::startElement(), PD_Document::updateStatus(), UT_createTmpFile(), ODe_Style_Style::ParagraphProps::write(), ODe_Style_PageLayout::write(), ODe_Style_MasterPage::write(), ODe_Style_List::write(), ODe_Numbered_ListLevelStyle::write(), and ODe_Bullet_ListLevelStyle::write().