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

void PHTTPCompositeField::SetName ( const PString newName ) [virtual, inherited]

Set the name for the field.

Reimplemented from PHTTPField.

Definition at line 581 of file httpform.cxx.

References PString::Find(), PString::GetLength(), PHTTPField::GetName(), PString::IsEmpty(), PString::Mid(), and PHTTPField::SetName().

Referenced by PHTTPCompositeField::LoadFromConfig().

{
  if (fullName.IsEmpty() || newName.IsEmpty())
    return;

  for (PINDEX i = 0; i < fields.GetSize(); i++) {
    PHTTPField & field = fields[i];

    PString firstPartOfName = psprintf(fullName, i+1);
    PString subFieldName;
    if (field.GetName().Find(firstPartOfName) == 0)
      subFieldName = field.GetName().Mid(firstPartOfName.GetLength());
    else
      subFieldName = field.GetName();

    firstPartOfName = psprintf(newName, i+1);
    if (subFieldName[0] == '\\' || firstPartOfName[firstPartOfName.GetLength()-1] == '\\')
      field.SetName(firstPartOfName + subFieldName);
    else
      field.SetName(firstPartOfName & subFieldName);
  }

  PHTTPField::SetName(newName);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index