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


C++ TextWriter类代码示例

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


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

示例1: WriteTo

void InvokeContainerApiRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("ActivateContainerRequest { ");
    w.Write("ApiExecArgs = {0}", apiExecArgs_);
    w.Write("TimeoutTicks = {0}", timeoutTicks_);
    w.Write("}");
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:7,代码来源:InvokeContainerApiRequest.cpp

示例2: WriteTo

void TestMultiPackageHostContext::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("TestMultiPackageHostContext { ");
    w.Write("NodeId = {0}, ", nodeId_);
    w.Write("HostId = {0}, ", hostId_);
    w.Write("}");
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:7,代码来源:TestMultiPackageHostContext.cpp

示例3: WriteTo

        void WriteTo(TextWriter& w, FormatOptions const&) const
        {
            // Keep strong references for tracing outside the 
            // lock since these may the last references and when 
            // they release, the OnReleaseReference() callback will 
            // be executed, acquiring the lock again.
            //
            unordered_map<uint64, ComponentRootSPtr> referencesCopy;
            {
                AcquireReadLock lock(lock_);

                for (auto const & reference : references_)
                {
                    auto sptr = reference.second.lock();

                    if (sptr.get() != nullptr)
                    {
                        referencesCopy[reference.first] = sptr;
                    }
                }
            }
                
            w.Write("count={0}\n", referencesCopy.size());

            for (auto const & reference : referencesCopy)
            {
                w.Write(*(reference.second));
            }
        }
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:29,代码来源:componentroot.cpp

示例4: WriteTo

void PackageSharingPolicyDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("PackageSharingPolicyDescription { ");
    w.Write("PackageRef = {0}, ", PackageRef);
    w.Write("Scope = {0},", Scope);
    w.Write("}");
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:7,代码来源:PackageSharingPolicyDescription.cpp

示例5: rewrite

QString RewriteBinding::rewrite(QString code, unsigned position,
                                AST::Statement *node)
{
    TextWriter w;
    _writer = &w;
    _position = position;
    _inLoop = 0;

    accept(node);

    unsigned startOfStatement = node->firstSourceLocation().begin() - _position;
    unsigned endOfStatement = node->lastSourceLocation().end() - _position;

    _writer->replace(startOfStatement, 0, QLatin1String("(function ") + QString::fromUtf8(_name) + QLatin1String("() { "));
    _writer->replace(endOfStatement, 0, QLatin1String(" })"));

    if (rewriteDump()) {
        qWarning() << "=============================================================";
        qWarning() << "Rewrote:";
        qWarning() << qPrintable(code);
    }

    w.write(&code);

    if (rewriteDump()) {
        qWarning() << "To:";
        qWarning() << qPrintable(code);
        qWarning() << "=============================================================";
    }

    return code;
}
开发者ID:,项目名称:,代码行数:32,代码来源:

示例6: TEST

TEST(TextWriterTest, t2)
{
    std::string outfile(Support::temppath("utm17.txt"));
    std::string infile(Support::datapath("text/utm17_2.txt"));

    FileUtils::deleteFile(outfile);

    TextReader r;
    Options ro;

    ro.add("filename", infile);
    r.setOptions(ro);

    TextWriter w;
    Options wo;

    wo.add("filename", outfile);
    wo.add("order", "X,Y,Z");
    wo.add("quote_header", false);
    wo.add("precision", 2);
    wo.add("delimiter", "  ");
    w.setOptions(wo);
    w.setInput(r);

    PointTable t;

    w.prepare(t);
    w.execute(t);

    EXPECT_EQ(Support::compare_text_files(infile, outfile), true);
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例7: WriteTo

void RegisterContainerActivatorServiceRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("RegisterContainerActivatorServiceRequest { ");
    w.Write("ProcessId = {0}", processId_);
    w.Write("ListenAddress = {0}", listenAddress_);
    w.Write("}");
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:7,代码来源:RegisterContainerActivatorServiceRequest.cpp

示例8: file

void EdApp::SavePersistentData()
{
	// Save layout
	{
		QFile		file(ED_PATH_TO_APP_LAYOUT);
		file.open(QIODevice::WriteOnly);
		if( !file.isOpen() ) {
			mxWarnf("Failed to save layout to file '%s'.\n",ED_PATH_TO_APP_LAYOUT);
			return;
		}

		QDataStream	stream( &file );
		this->SerializeWidgetLayout(stream);
	}

	// Save current settings
	{
		FileWriter	file( ED_PATH_TO_APP_SETTINGS );
		if( file.IsOpen() )
		{
			TextWriter	archive;

			EdSystem::Get().settings.Serialize( archive );

			EdSystem::Get().Event_SerializeAppData( archive );

			archive.WriteAllToStream( file );
		}
	}
}
开发者ID:S-V,项目名称:Lollipop,代码行数:30,代码来源:app.cpp

示例9: protect

void
Marks::MarkLocation(const GeoPoint &loc,
                    const BrokenDateTime &time,
                    bool play_sound)
{
  Poco::ScopedRWLock protect(lock, true);

  if (play_sound)
    PlayResource(_T("IDR_WAV_CLEAR"));

  marker_store.push_back(loc);

  char message[160];
  sprintf(message, "%02u.%02u.%04u\t%02u:%02u:%02u\tLon:%f\tLat:%f",
          time.day, time.month, time.year,
          time.hour, time.minute, time.second,
          (double)(loc.Longitude.value_degrees()), 
          (double)(loc.Latitude.value_degrees()));

  TextWriter *writer = CreateDataTextFile(_T("xcsoar-marks.txt"), true);
  if (writer != NULL) {
    writer->writeln(message);
    delete writer;
  }
}
开发者ID:galippi,项目名称:xcsoar,代码行数:25,代码来源:Marks.cpp

示例10: WriteTo

void FabricHostOperationReply::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("FabricHostOperationReply { ");
    w.Write("Error = {0}", error_);
    w.Write("Error message = {0}", errorMessage_);
    w.Write("Data = {0}", data_);
    w.Write("}");
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:8,代码来源:FabricHostOperationReply.cpp

示例11: WriteTo

void UpdateCodePackageContextRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("UpdateCodePackageContextRequest { ");
    w.Write("CodeContext = {0}, ", CodeContext);
    w.Write("ActivationId = {0}, ", ActivationId);
    w.Write("Timeout = {0}, ", Timeout);
    w.Write("}");
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:8,代码来源:UpdateCodePackageContextRequest.cpp

示例12: WriteTo

void SecurityAccessPolicyDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("SecurityAccessPolicyDescription { ");
    w.Write("ResourceRef = {0}, ", ResourceRef);
    w.Write("PrincipalRef = {0}, ", PrincipalRef);
    w.Write("Rights = {0}", Rights);
    w.Write("}");
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:8,代码来源:SecurityAccessPolicyDescription.cpp

示例13: WriteTo

void DeactivateCodePackageRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("DeactivateCodePackageRequest { ");
    w.Write("CodePackageInstanceId = {0}, ", codePackageInstanceId_);
    w.Write("ActivationId = {0}, ", ActivationId);
    w.Write("Timeout = {0}, ", Timeout);
    w.Write("}");
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:8,代码来源:DeactivateCodePackageRequest.cpp

示例14:

void SharableProxy::RecordVector::WriteTo(TextWriter& w, FormatOptions const&) const
{
    w.Write("{0}\r\n", instance_);

    for (ArbitrationRecord const & record : records_)
    {
        w.Write("{0}:{1}\r\n", record.Monitor, record.ExpireTime);
    }
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:9,代码来源:SharableProxy.cpp

示例15:

void
WayPointFileWinPilot::composeFlags(TextWriter &writer,
                                   const WaypointFlags &src)
{
  if (src.Airport)
    writer.write('A');
  if (src.TurnPoint)
    writer.write('T');
  if (src.LandPoint)
    writer.write('L');
  if (src.Home)
    writer.write('H');
  if (src.StartPoint)
    writer.write('S');
  if (src.FinishPoint)
    writer.write('F');
  if (src.Restricted)
    writer.write('R');
  if (src.WaypointFlag)
    writer.write('W');

  // set as turnpoint by default if nothing else
  if (!src.Airport && !src.TurnPoint && !src.LandPoint && !src.Home &&
      !src.StartPoint && !src.FinishPoint && !src.Restricted &&
      !src.WaypointFlag)
    writer.write('T');
}
开发者ID:galippi,项目名称:xcsoar,代码行数:27,代码来源:WayPointFileWinPilot.cpp


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