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


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

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


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

示例1:

void
SKKCandList::get_annot_string (WideString &result)
{
    if (!visible_table()) {
        result += get_annot_from_vector();
    } else {
        int i = get_current_page_start();
        int s = get_current_page_size();
        bool is_first = true;
        int cpos = get_cursor_pos_in_current_page();
        for (int j = 0; j < s; i++, j++) {
            std::vector<ucs4_t>::const_iterator start, end;
            start = m_annot_buf->m_buffer.begin() + m_annot_buf->m_index[i];
            if (i < number_of_candidates() - 1)
                end = m_annot_buf->m_buffer.begin()+m_annot_buf->m_index[i+1];
            else
                end = m_annot_buf->m_buffer.end();
            if (start != end && (annot_target || j == cpos)) {
                if (is_first)
                    is_first = false;
                else
                    result += utf8_mbstowcs("  ");
                if (annot_target) {
                    result += get_candidate_label(j);
                    result += utf8_mbstowcs(".");
                }
                result.append(start, end);
            }
        }
    }
}
开发者ID:tzhuan,项目名称:scim-skk,代码行数:31,代码来源:scim_skk_lookup_table.cpp

示例2: getListItemString

WideString Builder::getListItemString(Layout *parent, Layout &l) {
	WideString str;

	switch (l.style.listStyleType) {
	case style::ListStyleType::None: break;
	case style::ListStyleType::Circle: str += u"◦ "; break;
	case style::ListStyleType::Disc: str += u"• "; break;
	case style::ListStyleType::Square: str += u"■ "; break;
	case style::ListStyleType::XMdash: str += u"— "; break;
	case style::ListStyleType::Decimal:
		str += string::toUtf16(toString(parent->listItemIndex, ". "));
		parent->listItemIndex += ((parent->listItem==Layout::ListReversed)?-1:1);
		break;
	case style::ListStyleType::DecimalLeadingZero:
		str += string::toUtf16(toString("0", parent->listItemIndex, ". "));
		parent->listItemIndex += ((parent->listItem==Layout::ListReversed)?-1:1);
		break;
	case style::ListStyleType::LowerAlpha:
		str.append(Builder_getLatinBullet(parent->listItemIndex, false)).append(u". ");
		parent->listItemIndex += ((parent->listItem==Layout::ListReversed)?-1:1);
		break;
	case style::ListStyleType::LowerGreek:
		str.append(Builder_getGreekBullet(parent->listItemIndex)).append(u". ");
		parent->listItemIndex += ((parent->listItem==Layout::ListReversed)?-1:1);
		break;
	case style::ListStyleType::LowerRoman:
		str.append(Builder_getRomanBullet(parent->listItemIndex, false)).append(u". ");
		parent->listItemIndex += ((parent->listItem==Layout::ListReversed)?-1:1);
		break;
	case style::ListStyleType::UpperAlpha:
		str.append(Builder_getLatinBullet(parent->listItemIndex, true)).append(u". ");
		parent->listItemIndex += ((parent->listItem==Layout::ListReversed)?-1:1);
		break;
	case style::ListStyleType::UpperRoman:
		str.append(Builder_getRomanBullet(parent->listItemIndex, true)).append(u". ");
		parent->listItemIndex += ((parent->listItem==Layout::ListReversed)?-1:1);
		break;
	}

	return str;
}
开发者ID:SBKarr,项目名称:stappler,代码行数:41,代码来源:SPRichTextBuilderBullet.cpp

示例3: RunFile

bool CScript::RunFile( WideString a_fileName )
{
    FILE* scriptFile = NULL;
    char* fileString = NULL;
    int fileSize = 0;
    bool result = true;

    //a_fileName = APP.useFile( wide2string(a_fileName).c_str() ).c_str();
    a_fileName = wide2string( a_fileName ).c_str();

    GM_ASSERT( this );

    if ( APP.DebugMode )
    {
      WideString winfo = "Loading script file ";
      winfo += a_fileName;
      CONSOLE.add( winfo );
    }

    char* ResultChar = new char[1024]; 
    wcstombs( ResultChar, a_fileName.c_str(), 1024 );

    if ( !( scriptFile = fopen( ResultChar, "rb" ) ) )
    {
      return false;
    }

    fseek( scriptFile, 0, SEEK_END );
    fileSize = ftell( scriptFile );
    fseek( scriptFile, 0, SEEK_SET );
    fileString = new char[fileSize + 1];
    fread( fileString, fileSize, 1, scriptFile );
    fileString[fileSize] = 0; // Terminating null
    fclose( scriptFile );

    int threadId = GM_INVALID_THREAD;
    errors = machine->ExecuteString( fileString, &threadId, true, ResultChar );
    if ( errors )
    {
      WideString a;
      a = "Script error: "; a.append( a_fileName );
      LogErrors( a );
      result = false;
    }

    deltaTime = 1;
    lastTime = getPreciseTime();

    delete[] fileString;
    delete ResultChar;

    return result;
}
开发者ID:master4523,项目名称:crimsonglory,代码行数:53,代码来源:script.cpp

示例4: RunString

bool CScript::RunString( WideString a_string )
{
    GM_ASSERT( this );

    int threadId = GM_INVALID_THREAD;

    char* ResultChar = new char[1024]; 
    wcstombs( ResultChar, a_string.c_str(), 1024 );

    errors = machine->ExecuteString( ResultChar, &threadId, true );
    if ( errors )
    {
      WideString a;
      a = "Script error: "; a.append( a_string );
      LogErrors( a );
    }

    deltaTime = 1;
    lastTime = getPreciseTime();

    delete ResultChar;

    return true;
}
开发者ID:master4523,项目名称:crimsonglory,代码行数:24,代码来源:script.cpp

示例5: substring

WideString Editor::substring(int a, int b)
{
  POINT pta = toPoint(a);
  POINT ptb = toPoint(b);
  WideString result;
  if (pta.y == ptb.y)
    result.append(lines[pta.y].text.c_str() + pta.x, ptb.x - pta.x);
  else
  {
    result.append(lines[pta.y].text.c_str() + pta.x, lines[pta.y].text.length() - pta.x);
    result.append(L"\r\n", 2);
    for (int y = pta.y + 1; y < ptb.y; y++)
    {
      result.append(lines[y].text, lines[y].text.length());
      result.append(L"\r\n", 2);
    }
    result.append(lines[ptb.y].text, ptb.x);
  }
  return result;
}
开发者ID:Soulflare3,项目名称:ilua,代码行数:20,代码来源:editor.cpp


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