Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

void wxPropertyGrid::ArrayStringToString ( wxString &  dst,
const wxArrayString &  src,
wxChar  preDelim,
wxChar  postDelim,
int  flags 
) [static]

Generates contents for string dst based on the convetents of wxArrayString src. Format will be <preDelim>str1<postDelim> <preDelim>str2<postDelim> and so on. Set flags to 1 inorder to convert backslashes to double-back- slashes and "<preDelims>"'s to "\<preDelims>".

Definition at line 2406 of file props.cpp.

{
    wxString pdr;

    unsigned int i;
    unsigned int itemCount = src.GetCount();

    wxChar preas[2];

    dst.Empty();

    if ( !preDelim )
        preas[0] = 0;
    else if ( (flags & 1) )
    {
        preas[0] = preDelim;
        preas[1] = 0;
        pdr = wxT("\\");
        pdr += preDelim;
    }

    if ( itemCount )
        dst.append( preas );

    wxASSERT( postDelim );

    for ( i = 0; i < itemCount; i++ )
    {
        wxString str( src.Item(i) );

        // Do some character conversion.
        // Convertes \ to \\ and <preDelim> to <preDelim>
        // Useful when preDelim and postDelim are "\"".
        if ( flags & 1 )
        {
            str.Replace( wxT("\\"), wxT("\\\\"), true );
            if ( pdr.length() )
                str.Replace( preas, pdr, true );
        }

        dst.append ( str );

        if ( i < (itemCount-1) )
        {
            dst.append( wxString(postDelim) );
            dst.append( wxT(" ") );
            dst.append( wxString(preas) );
        }
        else if ( preDelim )
            dst.append( wxString(postDelim) );
    }
}

Generated by  Doxygen 1.6.0   Back to index