• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TextStream类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: layerTreeAsText

String GraphicsLayer::layerTreeAsText(LayerTreeAsTextBehavior behavior) const
{
    TextStream ts;

    dumpLayer(ts, 0, behavior);
    return ts.release();
}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:7,代码来源:GraphicsLayer.cpp


示例2: htmlForLink

 static String htmlForLink(int x, int y, int width, int height, const char* url)
 {
     TextStream ts;
     ts << "<a style='position: absolute; left: " << x << "px; top: " << y << "px; width: " << width << "px; height: " << height
         << "px' href='" << url << "'>" << url << "</a>";
     return ts.release();
 }
开发者ID:kjthegod,项目名称:WebKit,代码行数:7,代码来源:PrintContextTest.cpp


示例3: dump

void PDFDocumentImage::dump(TextStream& ts) const
{
    Image::dump(ts);
    ts.dumpProperty("page-count", pageCount());
    ts.dumpProperty("crop-box", m_cropBox);
    if (m_rotationDegrees)
        ts.dumpProperty("rotation", m_rotationDegrees);
}
开发者ID:caiolima,项目名称:webkit,代码行数:8,代码来源:PDFDocumentImage.cpp


示例4: readEfpParamsSection

void QChemInput::readEfpParamsSection(TextStream& textStream)
{
   EfpFragment parser;
   while (!textStream.atEnd()) {
      parser.loadNextFragment(textStream);
      if (textStream.previousLine().contains("$end", Qt::CaseInsensitive)) break;
   }
}
开发者ID:nutjunkie,项目名称:IQmol,代码行数:8,代码来源:QChemInputParser.C


示例5: dump

void Image::dump(TextStream& ts) const
{
    if (isAnimated())
        ts.dumpProperty("animated", isAnimated());

    if (isNull())
        ts.dumpProperty("is-null-image", true);

    ts.dumpProperty("size", size());
}
开发者ID:hnney,项目名称:webkit,代码行数:10,代码来源:Image.cpp


示例6: TextStream

bool
AsxParser::ParseBuffer (MemoryBuffer *buffer)
{
	this->buffer = buffer;
	TextStream *stream = new TextStream ();
	buffer->SeekSet (0);
	stream->OpenBuffer ((char *) buffer->GetCurrentPtr (), buffer->GetSize ());

	return parser->parse_stream (stream);
}
开发者ID:499940913,项目名称:moon,代码行数:10,代码来源:asxparser.cpp


示例7: externalRepresentation

static String externalRepresentation(RenderBox* renderer, RenderAsTextBehavior behavior)
{
    TextStream ts;
    if (!renderer->hasLayer())
        return ts.release();

    RenderLayer* layer = renderer->layer();
    RenderTreeAsText::writeLayers(ts, layer, layer, layer->rect(), 0, behavior);
    return ts.release();
}
开发者ID:hackerkevin,项目名称:sky_engine,代码行数:10,代码来源:RenderTreeAsText.cpp


示例8: layerTreeAsText

String LayerRendererChromium::layerTreeAsText() const
{
    TextStream ts;
    if (rootLayer()) {
        ts << rootLayer()->layerTreeAsText();
        ts << "RenderSurfaces:\n";
        dumpRenderSurfaces(ts, 1, rootLayer());
    }
    return ts.release();
}
开发者ID:RasterCode,项目名称:wke,代码行数:10,代码来源:LayerRendererChromium.cpp


示例9: while

MacroDef::eAppendStat MacroDef::AppendMacroExpansion
(TextStream & text)
{
  char c;
  bool stat;
  while (text.Consume(c))
    {
	  if ('%' == c)
		{
		  if (text.Expect ("%"))
			{
			  // escape of '%' character: that's OK
			  _definition.Append (c);
			  _definition.Append (c);
			  continue;
			}

		  int argIdx = 0;
		  for (int digitCount = 0; digitCount < 2; digitCount++)
			{
			  stat = text.Consume(c);
			  if (! stat)
				{
				  return kAppendBadArg;
				}
			  if ((c >= '0') && (c <= '9'))
				{
				  // valid arg values
				  if (0 == digitCount)
					{
					  _definition.Append ('%');
					}
				  _definition.Append (c);
				  argIdx = argIdx*10 + (c - '0');
				  if (argIdx > _numArgs)
					{
					  return kAppendArgRange;
					}
				  continue;
				}
			  else
				{
				  return kAppendBadArg;
				}
			}
		}

	  else
		{
		  _definition.Append (c);
		}
    }
  return kAppendNoError;
}
开发者ID:mcanthony,项目名称:aaf,代码行数:54,代码来源:MacroDef.cpp


示例10: readEfpFragmentSection

void QChemInput::readEfpFragmentSection(TextStream& textStream)
{
   // Check for an existing list from the $molecule section
   Data::EfpFragmentList* efps(0);
   QList<Data::EfpFragmentList*> lists = m_dataBank.findData<Data::EfpFragmentList>();
   if (lists.isEmpty()) {
      efps = new Data::EfpFragmentList;
      m_dataBank.append(efps);
   }else {
      efps = lists.last();
   }

   QString msg("Invalid $efp_fragments format on line ");
   QStringList tokens;
   bool ok, allOk;
   int count(1);

   while (!textStream.atEnd()) {
      tokens = textStream.nextLineAsTokens();

      if (tokens.size() == 1 && tokens[0].contains("$end", Qt::CaseInsensitive)) {
         break;

      }else if (tokens.size() < 7) {
         Data::EfpFragment* efp(0);
         if (count <= efps->size()) {
            efp = efps->at(count-1);
         }else {
            efp = new Data::EfpFragment;
            efps->append(efp);
         }
         efp->setName(tokens[0]);
 
      }else {
         allOk = true;
         QString name(tokens[0]);
         double x, y, z, a, b, c;
         if (allOk) x = tokens[1].toDouble(&ok);  allOk = allOk && ok;
         if (allOk) y = tokens[2].toDouble(&ok);  allOk = allOk && ok;
         if (allOk) z = tokens[3].toDouble(&ok);  allOk = allOk && ok;
         if (allOk) a = tokens[4].toDouble(&ok);  allOk = allOk && ok;
         if (allOk) b = tokens[5].toDouble(&ok);  allOk = allOk && ok;
         if (allOk) c = tokens[6].toDouble(&ok);  allOk = allOk && ok;

         if (allOk) {
            efps->append(new Data::EfpFragment(name, qglviewer::Vec(x,y,z), a, b, c));
         }else {
            m_errors.append(msg += QString::number(textStream.lineNumber()));
         }
      }
      ++count;
   }
}
开发者ID:nutjunkie,项目名称:IQmol,代码行数:53,代码来源:QChemInputParser.C


示例11: group

void DisplayList::dump(TextStream& ts) const
{
    TextStream::GroupScope group(ts);
    ts << "display list";

    size_t numItems = m_list.size();
    for (size_t i = 0; i < numItems; ++i) {
        TextStream::GroupScope scope(ts);
        ts << i << " " << m_list[i].get();
    }
    ts.startGroup();
    ts << "size in bytes: " << sizeInBytes();
    ts.endGroup();
}
开发者ID:eocanha,项目名称:webkit,代码行数:14,代码来源:DisplayList.cpp


示例12: counterValueForElement

String counterValueForElement(Element* element)
{
    // Make sure the element is not freed during the layout.
    RefPtr<Element> elementRef(element);
    element->document()->updateLayout();
    TextStream stream;
    bool isFirstCounter = true;
    // The counter renderers should be children of :before or :after pseudo-elements.
    if (RenderObject* before = element->pseudoElementRenderer(BEFORE))
        writeCounterValuesFromChildren(stream, before, isFirstCounter);
    if (RenderObject* after = element->pseudoElementRenderer(AFTER))
        writeCounterValuesFromChildren(stream, after, isFirstCounter);
    return stream.release();
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:14,代码来源:RenderTreeAsText.cpp


示例13: LOG_DOWNLOADER

char *
Downloader::GetResponseText (const char *partname, gint64 *size)
{
	LOG_DOWNLOADER ("Downloader::GetResponseText (%s, %p)\n", partname, size);

	TextStream *stream;
	char buffer[4096];
	GByteArray *buf;
	struct stat st;
	ssize_t nread;
	char *data;
	char *path;
	
	if (!(path = GetDownloadedFilename (partname)))
		return NULL;
	
	if (g_stat (path, &st) == -1) {
		g_free (path);
		return NULL;
	}
	
	if (st.st_size > 0) {
		stream = new TextStream ();
		
		if (!stream->OpenFile (path, true)) {
			delete stream;
			g_free (path);
			return NULL;
		}
		
		g_free (path);
		
		buf = g_byte_array_new ();
		while ((nread = stream->Read (buffer, sizeof (buffer))) > 0)
			g_byte_array_append (buf, (const guint8 *) buffer, nread);
		
		*size = buf->len;
		
		g_byte_array_append (buf, (const guint8 *) "", 1);
		data = (char *) buf->data;
		
		g_byte_array_free (buf, false);
		delete stream;
	} else {
		data = g_strdup ("");
		*size = 0;
	}
	
	return data;
}
开发者ID:snorp,项目名称:moon,代码行数:50,代码来源:downloader.cpp


示例14: testConstructFromStream

    void testConstructFromStream(){
        TextStream stream;
        stream.writeLine( "MasterFeder=1" );
        stream.writeLine( "MasterPanpot=2" );
        stream.writeLine( "MasterMute=3" );
        stream.writeLine( "OutputMode=4" );
        stream.writeLine( "Tracks=1" );
        stream.writeLine( "Feder0=5" );
        stream.writeLine( "Panpot0=6" );
        stream.writeLine( "Mute0=7" );
        stream.writeLine( "Solo0=8" );
        stream.setPointer( -1 );

        std::string lastLine = "";
        Mixer mixer( stream, lastLine );

        CPPUNIT_ASSERT_EQUAL( (std::size_t)1, mixer.slave.size() );
        CPPUNIT_ASSERT_EQUAL( 1, mixer.masterFeder );
        CPPUNIT_ASSERT_EQUAL( 2, mixer.masterPanpot );
        CPPUNIT_ASSERT_EQUAL( 3, mixer.masterMute );
        CPPUNIT_ASSERT_EQUAL( 4, mixer.outputMode );
        CPPUNIT_ASSERT_EQUAL( 5, mixer.slave[0].feder );
        CPPUNIT_ASSERT_EQUAL( 6, mixer.slave[0].panpot );
        CPPUNIT_ASSERT_EQUAL( 7, mixer.slave[0].mute );
        CPPUNIT_ASSERT_EQUAL( 8, mixer.slave[0].solo );
    }
开发者ID:qtau-devgroup,项目名称:libvsq,代码行数:26,代码来源:MixerTest.cpp


示例15: parse

bool ExternalCharges::parse(TextStream& textStream) 
{
   int max(INT_MAX);
   bool allOk(true), isDouble;
   bool maxSet(false), invalidFormat(false);
   double x, y, z, q;
   QStringList tokens;
   Data::PointChargeList* charges(new Data::PointChargeList);

   while (!textStream.atEnd() && charges->size() < max) {
      tokens = textStream.nextLineAsTokens();
      if (tokens.size() >= 4) {
         x = tokens[0].toDouble(&isDouble);  allOk = allOk && isDouble;
         y = tokens[1].toDouble(&isDouble);  allOk = allOk && isDouble;
         z = tokens[2].toDouble(&isDouble);  allOk = allOk && isDouble;
         q = tokens[3].toDouble(&isDouble);  allOk = allOk && isDouble;

         if (allOk) {
            charges->append(new Data::PointCharge(q, qglviewer::Vec(x,y,z)));
         }else {
            invalidFormat = true;
            break;
         }
      }else if (tokens.size() >= 1) {
         if (tokens.first().contains("$end", Qt::CaseInsensitive) || maxSet) {
            break;
         }else {
            max = tokens[0].toInt(&maxSet);
         }
      }
   } 

   if (maxSet && charges->size() != max) {
      if (invalidFormat) {
         QString msg("Invalid format on line ");
         m_errors.append(msg += QString::number(textStream.lineNumber()));
      }else {
         m_errors.append("End of stream encountered");
      }
      delete charges;
   }else if (charges->isEmpty()) {
      m_errors.append("No charges found");
      delete charges;
   }else {
      m_dataBank.append(charges);
   }

   return m_errors.isEmpty();
}
开发者ID:autodataming,项目名称:IQmol,代码行数:49,代码来源:ExternalChargesParser.C


示例16: main

int main (int argc, const char* argv[])
{
	if (argc != 2) {
		printf ("pass in an ASX file to parse.\n");
		return -1;
	}

	TextStream *ts = new TextStream ();

	printf ("opening the file: %s\n", argv [1]);
	ts->OpenFile (argv [1], true);

	AsxParserInternal *asx = new AsxParserInternal (ts);
	asx->run ();
}
开发者ID:499940913,项目名称:moon,代码行数:15,代码来源:asxparser.cpp


示例17: switch

//------------------------------------------------------------------------------
//!
bool
DFNoiseImageNode::dumpCustom( TextStream& os, StreamIndent& indent ) const
{
   os << indent << "type = " << _type << "," << nl;
   switch( _type )
   {
      case TYPE_CELL:
      case TYPE_PERLIN:
         break;
      case TYPE_PERLIN_FILTERED:
         os << indent << "perfilwidth = " << _perFil._width << "," << nl;
         break;
      case TYPE_VORONOI:
         os << indent << "jitter = " << _vor._jitter << "," << nl;
         break;
      case TYPE_FBM:
         os << indent << "fbmwidth = " << _fbm._width << "," << nl;
         os << indent << "octaves = " << _fbm._octaves << "," << nl;
         os << indent << "lacunarity = " << _fbm._lacunarity << "," << nl;
         os << indent << "gain = " << _fbm._gain << "," << nl;
         break;
      default:
         break;
   }
   return os.ok();
}
开发者ID:LudoSapiens,项目名称:Dev,代码行数:28,代码来源:DFImageGenerator.cpp


示例18: VMFmt

//------------------------------------------------------------------------------
//!
bool
DFMappingNode::dumpCustom( TextStream& os, StreamIndent& indent ) const
{
   os << indent << "scale = " << _scale << "," << nl;
   os << indent << "offset = " << VMFmt( _offset ) << "," << nl;
   return os.ok();
}
开发者ID:LudoSapiens,项目名称:Dev,代码行数:9,代码来源:DFGeomModifier.cpp


示例19: counterValueForElement

String counterValueForElement(Element* element)
{
    // Make sure the element is not freed during the layout.
    RefPtr<Element> elementRef(element);
    element->document()->updateLayout();
    TextStream stream;
    bool isFirstCounter = true;
    // The counter renderers should be children of anonymous children
    // (i.e., :before or :after pseudo-elements).
    if (RenderObject* renderer = element->renderer()) {
        for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling()) {
            if (child->isAnonymous())
                writeCounterValuesFromChildren(stream, child, isFirstCounter);
        }
    }
    return stream.release();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:17,代码来源:RenderTreeAsText.cpp


示例20: readNextDeclaration

void PovRay::readNextDeclaration(TextStream& textStream, Data::PovRay* povray)
{
   // looks for '#declare TextureName = '
   const QRegExp declare("^#declare\\s+(\\S+)\\s?="); 

   QString line(textStream.nextLine());
   if (!line.contains(declare)) line = textStream.seek(declare);

   if (!textStream.atEnd() && declare.indexIn(line) > -1) {
      QString name(declare.cap(1));
      // remove the initial IQmol_Texture_
      name.remove(0,14);
      name.replace("_", " ");
      line = textStream.nextBlock();
      povray->addTexture(name,line);
   }
}
开发者ID:autodataming,项目名称:IQmol,代码行数:17,代码来源:PovRayParser.C



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TextStyle类代码示例发布时间:2022-05-31
下一篇:
C++ TextSplitter类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap