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


C++ AOutputBuffer::append方法代码示例

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


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

示例1: emitPath

void AXmlElement::emitPath(AOutputBuffer& target) const
{
  if (mp_Parent)
    mp_Parent->emitPath(target);

  target.append(AConstant::ASTRING_SLASH);
  target.append(m_Name);
}
开发者ID:achacha,项目名称:AOS,代码行数:8,代码来源:AXmlElement.cpp

示例2: emit

 /*!
 AEmittable
 */
 void emit(AOutputBuffer& target) const
 {
   target.append('{');
   target.append(AString::fromPointer(m_Pointer));
   if (m_Ownership)
     target.append(";owned",6);
   target.append('}');
 }
开发者ID:achacha,项目名称:AOS,代码行数:11,代码来源:templateAutoPtr.hpp

示例3: generateRandomWord

void ATextGenerator::generateRandomWord(AOutputBuffer& target, size_t len /* = 0x1 */)
{
  if (len < 1)
    return;

  //a_Lead with consonant
  --len;
  AString str, strLast("-", 1);
  generateRandomString(str, 1, AConstant::CHARSET_LOWERCASE_CONSONANTS);
  str.makeUpper();
  target.append(str);

  bool boolConsonant = false;
  while (len > 0)
  {
    if (boolConsonant)
    {
      //a_Add a consonant    
      do
      {
        str.clear();
        generateRandomString(str, 1, AConstant::CHARSET_LOWERCASE_CONSONANTS);
      }
      while(str.at(0) == strLast.at(0) && ARandomNumberGenerator::get().nextU1() > 220);

      target.append(str);
      --len;
      strLast = str;
      boolConsonant = false;
    }
    else
    {
      //a_Add a vowel
      int twice = 0;
      do
      {
        do
        {
          str.clear();
          generateRandomString(str, 1, AConstant::CHARSET_LOWERCASE_VOWELS);
        }
        while(str.at(0) == strLast.at(0) && ARandomNumberGenerator::get().nextU1() > 130);

        target.append(str);
        --len;
        strLast = str;
      }
      while (len > 0 && twice++ < 2 && ARandomNumberGenerator::get().nextU1() > 225);
  
      boolConsonant = true;
    }
  }
}
开发者ID:achacha,项目名称:AOS,代码行数:53,代码来源:ATextGenerator.cpp

示例4: generateUniqueId

void ATextGenerator::generateUniqueId(AOutputBuffer& target, size_t size /* = 32 */)
{
  if (size < 16)
    ATHROW(NULL, AException::InvalidParameter);

  ARope rope;
  size_t x = ATime::getTickCount();
  rope.append((const char *)&x, sizeof(size_t));
  
  size_t bytesToAdd = size - sizeof(size_t);
  while(bytesToAdd >= 4) 
  {
    x = ARandomNumberGenerator::get(ARandomNumberGenerator::Lecuyer).nextU4();
    rope.append((const char *)&x, 4); 
    bytesToAdd -= 4; 
  }
  while(bytesToAdd > 0)
  {
    x = ARandomNumberGenerator::get(ARandomNumberGenerator::Lecuyer).nextU1();
    rope.append((const char *)&x, 1);
    --bytesToAdd;
  }

  AASSERT(NULL, !bytesToAdd);
  AString str(rope.getSize() * 2, 256);
  ATextConverter::encode64(rope, str);
  AASSERT(&str, str.getSize() >= size);
  target.append(str, size);
}
开发者ID:achacha,项目名称:AOS,代码行数:29,代码来源:ATextGenerator.cpp

示例5: generateRandomString

void ATextGenerator::generateRandomString(AOutputBuffer& target, size_t len, const AString& strCharSet)
{
  for (size_t i = 0x0; i < len; ++i)
  {
    target.append(strCharSet.peek(ARandomNumberGenerator::get().nextRange(strCharSet.getSize())));
  }
}
开发者ID:achacha,项目名称:AOS,代码行数:7,代码来源:ATextGenerator.cpp

示例6: rope

void ATemplateNodeHandler_MODEL::Node::process(ATemplateContext& context, AOutputBuffer& output)
{
  AAutoPtr<AEventVisitor::ScopedEvent> scoped;
  if (context.useEventVisitor().isLogging(AEventVisitor::EL_DEBUG))
  {
    scoped.reset(new AEventVisitor::ScopedEvent(context.useEventVisitor(), ASW("ATemplateNodeHandler_MODEL",26), m_BlockData, AEventVisitor::EL_DEBUG));
  }

  if (m_BlockData.isEmpty())
    return;

  AXmlElement *pElement = context.useModel().useRoot().findElement(m_BlockData);
  if (pElement)
  {
    //a_Found object
    pElement->emitContent(output);
  }
  else
  {
    ARope rope("<!--Unable to find element for '",32); 
    rope.append(m_BlockData);
    rope.append("'-->",4); 
    output.append(rope);
  }
}
开发者ID:achacha,项目名称:AOS,代码行数:25,代码来源:ATemplateNodeHandler_MODEL.cpp

示例7: generateRandomData

void ATextGenerator::generateRandomData(AOutputBuffer& target, size_t len)
{
  for (size_t i = 0x0; i < len; ++i)
  {
    target.append(ARandomNumberGenerator::get().nextU1());
  }
}
开发者ID:achacha,项目名称:AOS,代码行数:7,代码来源:ATextGenerator.cpp

示例8: emitPath

void AFilename::emitPath(AOutputBuffer& target, AFilename::FTYPE ftype, bool noTrailingSlash) const
{
  char sep = '/';
  if (FTYPE_MSDOS == ftype)
    sep = '\\';

  //a_Drive
  if (m_Drive)
  {
    switch (ftype)
    {
      case FTYPE_UNIX: 
      break;

      case FTYPE_CYGWIN:
        target.append(ASW("/cygdrive/",10));
        target.append(m_Drive);
      break;
      
      default:
        if (!m_RelativePath)
        {
          target.append(m_Drive);
          target.append(':');
        }
    }
  }

  //a_Add slash is not a relative path
  if (!m_RelativePath)
    target.append(sep);
  else if (0 == m_PathNames.size())
  {
    //a_Special case, relative and no path, default to . or ./ (depends on noTailingSlash flag)
    target.append(AConstant::ASTRING_PERIOD);
    if (!noTrailingSlash)
      target.append(sep);

    return;
  }

  //a_Path
  LIST_AString::const_iterator cit = m_PathNames.begin();
  while (cit != m_PathNames.end())
  {
    target.append(*cit);
    ++cit;

    if (cit != m_PathNames.end() || !noTrailingSlash)
      target.append(sep);
  }
}
开发者ID:achacha,项目名称:AOS,代码行数:52,代码来源:AFilename.cpp

示例9: _indent

void AXmlElement::_indent(AOutputBuffer& target, int indent) const
{
  while (indent > 0)
  {
    target.append(AConstant::ASTRING_TWOSPACES);
    --indent;
  }
}
开发者ID:achacha,项目名称:AOS,代码行数:8,代码来源:AXmlElement.cpp

示例10: emitNoExt

void AFilename::emitNoExt(AOutputBuffer& target, AFilename::FTYPE ftype) const
{
  emitPath(target, ftype);

  size_t pos = m_Filename.rfind('.');
  if (AConstant::npos != pos)
    m_Filename.peek(target, 0, pos);
  else
    target.append(m_Filename);
}
开发者ID:achacha,项目名称:AOS,代码行数:10,代码来源:AFilename.cpp

示例11: emit

void AFilename::emit(
  AOutputBuffer& target, 
  AFilename::FTYPE ftype, 
  bool noTrailingSlash // = false
) const
{

  //a_Filename
  if (!m_Filename.isEmpty())
  {
    //a_Path
    emitPath(target, ftype);

    //a_Append filename
    target.append(m_Filename);
  }
  else 
  {
    //a_Check if trailing slash is not needed
    emitPath(target, ftype, noTrailingSlash);
  }
}
开发者ID:achacha,项目名称:AOS,代码行数:22,代码来源:AFilename.cpp

示例12: emitDrive

void AFilename::emitDrive(AOutputBuffer& target) const
{
  target.append(m_Drive);
}
开发者ID:achacha,项目名称:AOS,代码行数:4,代码来源:AFilename.cpp

示例13: emitFileUrl

void AFilename::emitFileUrl(AOutputBuffer& target) const
{
  target.append(FILE_PREFIX);
  emit(target, AFilename::FTYPE_DEFAULT);
}
开发者ID:achacha,项目名称:AOS,代码行数:5,代码来源:AFilename.cpp

示例14: emit

void AFragmentSet::emit(AOutputBuffer& target) const
{
	target.append(m_Set.at(m_Offset));
}
开发者ID:achacha,项目名称:AOS,代码行数:4,代码来源:AFragmentSet.cpp

示例15: emit

void AFragmentCounter::emit(AOutputBuffer& target) const
{
	target.append(m_strOdometer);
}
开发者ID:achacha,项目名称:AOS,代码行数:4,代码来源:AFragmentCounter.cpp


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