/**
******************************************************************************
*
* FUNCTION: Profile::XalanDomCString::XalanDomCString
*
* PURPOSE:  default constructor
*
* NOTES:
*
* @return  none
*
*****************************************************************************/

Profile::XalanDomCString::XalanDomCString ()
{

}

/**
******************************************************************************
*
* FUNCTION: Profile::XalanDomCString::XalanDomCString
*
* PURPOSE:  XalanDOMString constructor - creates STL string from XalanDOMString
*
* NOTES:
*
* @param   DomString (const XalanDOMString&) - (in) reference to the XalanDOMString to convert
*
* @return  none
*
*****************************************************************************/

Profile::XalanDomCString::XalanDomCString (const XalanDOMString& DomString)
{
    /* the transcode method transcodes the result string (UTF-16) to
        chars and stores them in a vector of chars.  the chars from
        the vector are then assigned to a std::string object by
        iterating through the vector.  once assigned to the string
        they are in a form we can use them.  If you're scratching your head,
        well yeah, I did too.  But this is the way the example code does it
        and I haven't seen anything to the contrary. */

    XalanVector<char> charData;

    DomString.transcode(charData);
    _myStdString.assign(charData.begin(), charData.end() - 1);

}

/**
******************************************************************************
*
* FUNCTION: Profile::XalanDomCString::~XalanDomCString
*
* PURPOSE:  destructor
*
* NOTES:
*
* @return  none
*
*****************************************************************************/

Profile::XalanDomCString::~XalanDomCString ()
{

}

/**
******************************************************************************
*
* FUNCTION: Profile::XalanDomCString::assign
*
* PURPOSE:  converts and assigns a XalanDOMString to a XalanDomCString
*
* NOTES:
*
* @param   DomString (const XalanDOMString&) - (in) reference to the XalanDOMString to convert
*
* @return  *this (XalanDomCString&) - reference to the XalanDomCString just assigned
*
*****************************************************************************/

Profile::XalanDomCString& Profile::XalanDomCString::assign (const XalanDOMString& DomString)
{
    //const char* pThisFnc = "Profile::XalanDomCString::assign";

    /* the transcode method transcodes the DOM string (UTF-16) to
        chars and stores them in a vector of chars.  the chars from
        the vector are then assigned to a std::string object by
        iterating through the vector.  once assigned to the string
        they are in a form we can use them.  If you're scratching your head,
        well yeah, I did too.  But this is the way the example code does it
        and I haven't seen anything to the contrary. */

    XalanVector<char> charData;

    DomString.transcode(charData);
    _myStdString.assign(charData.begin(), charData.end() - 1);

    return *this;
}

/**
******************************************************************************
*
* FUNCTION: Profile::XalanDomCString::getString
*
* PURPOSE:  returns a reference to a std::string representation of the DOM string
*
* NOTES:
*
* @return  noName (const string&) - reference to a STL string
*
*****************************************************************************/

const string& Profile::XalanDomCString::stdString () const
{
    return _myStdString;
}

/**
******************************************************************************
*
* FUNCTION: Profile::XalanDomCString::c_str
*
* PURPOSE:  returns a pointer to a C string representation of the DOM string
*
* NOTES:
*
* @return  noName (const char*) - pointer to C string
*
*****************************************************************************/


const char* Profile::XalanDomCString::c_str () const
{
    return _myStdString.c_str();
}


