当前位置: 首页>>代码示例>>C++>>正文


C++ TFile::WriteS方法代码示例

本文整理汇总了C++中TFile::WriteS方法的典型用法代码示例。如果您正苦于以下问题:C++ TFile::WriteS方法的具体用法?C++ TFile::WriteS怎么用?C++ TFile::WriteS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TFile的用法示例。


在下文中一共展示了TFile::WriteS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SaveXMLServidores

//-----------------------------------------------------------------------------
//::::::::::::::::::::::::::::::::::FICHERO XML::::::::::::::::::::::::::::::::::
//-----------------------------------------------------------------------------
void TAdministradora :: SaveXMLServidores(TGLinkedList* pList, AnsiString pFileName)
{
  TFile* fOut = new TFile(pFileName);
  fOut->Open("wt");

  fOut->WriteS("<?xml version=\"1.0\"?>");
  fOut->WriteS("\n");
  fOut->WriteS("<XML>");
  fOut->WriteS("\n"); //bien hasta aqui

  fOut->WriteS("<SERVERS>");
  fOut->WriteS("\n");

  for (int i = 0; i < pList->Length(); i++)
  {
    TServidor* server = (TServidor*)pList->ItemInfo(i);

    fOut->WriteS("<SERVER>");
    fOut->WriteS("\n");

   fOut->WriteS("<NAME_SERVER>");
    fOut->WriteS("\n");

    fOut->WriteS(server->NameDomain().c_str());
    fOut->WriteS("\n");

    fOut->WriteS("</NAME_SERVER>");
    fOut->WriteS("\n");

    fOut->WriteS("<TOP_ACCOUNTS>");
    fOut->WriteS("\n");

    fOut->WriteS(IntToStr(server->Tope()).c_str());
    fOut->WriteS("\n");

    fOut->WriteS("</TOP_ACCOUNTS>");
    fOut->WriteS("\n");


    fOut->WriteS("<LENGTH_EMAIL>");
    fOut->WriteS("\n");

    fOut->WriteS(IntToStr(server->Max()).c_str());
    fOut->WriteS("\n");

    fOut->WriteS("</LENGTH_EMAIL>");
    fOut->WriteS("\n");

    fOut->WriteS("<ACCOUNTS>");
    fOut->WriteS("\n");

    for(int j = 0; j < server->Cuentas()->Length();j++)
    {
      TCuenta* cuenta = (TCuenta*)server->Cuentas()->ItemInfo(j);

      fOut->WriteS("<ACCOUNT>");
      fOut->WriteS("\n");

      fOut->WriteS("<USER>");
      fOut->WriteS("\n");

      fOut->WriteS(cuenta->Usuario().c_str());
      fOut->WriteS("\n");

      fOut->WriteS("</USER>");
      fOut->WriteS("\n");

      fOut->WriteS("<CUOTA>");
      fOut->WriteS("\n");

      fOut->WriteS(IntToStr(cuenta->Cuota()).c_str());
      fOut->WriteS("\n");

      fOut->WriteS("</CUOTA>");
      fOut->WriteS("\n");


      fOut->WriteS("<PERSON>");
      fOut->WriteS("\n");


      fOut->WriteS("<NAME>");
      fOut->WriteS("\n");

      fOut->WriteS(cuenta->Person()->Name().c_str());
      fOut->WriteS("\n");

       fOut->WriteS("</NAME>");
      fOut->WriteS("\n");

      fOut->WriteS("<APELLIDOS>");
      fOut->WriteS("\n");

      fOut->WriteS(cuenta->Person()->Apellidos().c_str());
      fOut->WriteS("\n");

      fOut->WriteS("</APELLIDOS>");
//.........这里部分代码省略.........
开发者ID:sharstream,项目名称:MailServer-C,代码行数:101,代码来源:Administradora.cpp


注:本文中的TFile::WriteS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。