Class CTCPRelayHTTP::
ReplaceString()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: RelayNext page: Custom Code in Header Before Includes    Show member index
Private Function Declared in:
TCPRelayHTTP.h

'Declaration' icon -- Shortcut to top of page. Declaration

BOOL ReplaceString(
    std::string& rString) const;

'Description' icon -- Shortcut to top of page. Description

Replace the string

'Function Body' icon -- Shortcut to top of page. Function Body

try
{
    //Find the string
    std::string::size_type aPos;
    aPos=rString.find(m_sBindAddress,
                      0);

    //Do we have it
    if (aPos!=std::string::npos)
    {
        std::string sNewString;
        sNewString.reserve(rString.size()+30);

        //Take the part before the host
        sNewString=rString.substr(0,
                                  aPos);

        //Add the new address
        sNewString+=m_sTargetAddress;

        //Add what's left
        sNewString+=rString.substr(aPos+
                                   m_sBindAddress.length(),
                                   rString.length()-
                                   aPos-
                                   m_sBindAddress.length());

        //Give it to our string
        rString.swap(sNewString);

        //Done
        return TRUE;
    }
    else
        return FALSE;
}
ERROR_HANDLER_RETURN("ReplaceString",FALSE)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CTCPRelay  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003.