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


C++ StrUni::Append方法代码示例

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


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

示例1: sizeof

DEFINE_THIS_FILE

#if !WIN32
#include <netdb.h>
#include <unistd.h>
#include <sys/wait.h>
#include <time.h>
#endif

/*----------------------------------------------------------------------------------------------
	Get the name of the local FieldWorks database server.
----------------------------------------------------------------------------------------------*/
const wchar * SilUtil::LocalServerName()
{
	static StrUni s_stuLocalServer;
	if (!s_stuLocalServer.Length())
	{
#if WIN32
		wchar rgchComputer[MAX_COMPUTERNAME_LENGTH + 1];
		DWORD cch = MAX_COMPUTERNAME_LENGTH + 1;
		::GetComputerNameW(rgchComputer, &cch);
		s_stuLocalServer.Format(L"%s\\SILFW", rgchComputer);
#else
		const int max_compname_len = 4096; // TODOLinix this should be set to the maximun host length name
		char bufHost[max_compname_len + 1];
		size_t len = sizeof(bufHost);
		if(gethostname(bufHost, len) != 0)
		{
			hostent * host = gethostbyname(bufHost);
			s_stuLocalServer = host->h_name;
			s_stuLocalServer.Append("/SILFW");
		}
		else
		{
			s_stuLocalServer.Format(L"%S", bufHost);
			s_stuLocalServer.Append("/SILFW");
		}
#endif //WIN32
	}
	return s_stuLocalServer.Chars();
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:41,代码来源:UtilSil.cpp

示例2: FindBreakPoint


//.........这里部分代码省略.........
				int avgCharWidth = *pdxWidth / (grIchwMin + grIchwLimSeg);
				// we use 30000 here, because avgCharWidth is just an estimate,
				// this gives us some padding to ensure that the resulting segment
				// is less than the limit
				grIchwLim = grIchwMin + (30000 / avgCharWidth);
				pgrseg = new LineFillSegment(&font, pgts, &layout,
					grIchwMin, grIchwLim,
					(float)dxMaxWidth, fBacktracking);

				// reset variables for new segment
				gr::Font & fontSeg = pgrseg->getFont();
				pfontSeg = dynamic_cast<WinFont *>(&fontSeg);
				pfontSeg->replaceDC(hdc);

				*pest = pgrseg->segmentTermination();
				if (*pest != kestNothingFit)
				{
					*pdichwLimSeg = pgts->GrToVwOffset(pgrseg->stopCharacter() - pgrseg->startCharacter());
					*pdxWidth = gr::GrEngine::RoundFloat(pgrseg->advanceWidth());
				}
			}
		}

		strmLog.close();
	}
	catch (FontException & fexptn)
	{
		// Error in initializing the font.
		FontErrorCode ferr = fexptn.errorCode;
		LgCharRenderProps chrp;
		int ichwMinBogus, ichwLimBogus;
		pgts->GetCharProps(ichwMin, &chrp, &ichwMinBogus, &ichwLimBogus);
		StrUni stuMsg = L"Error in initializing Graphite font ";
		stuMsg.Append(chrp.szFaceName);
		stuMsg.Append(": ");
		std::wstring stuErrMsg = FontLoadErrorDescription(ferr, 0, 0, &hr);
		stuMsg.Append(stuErrMsg.c_str());
		StackDumper::RecordError(IID_IRenderEngine, stuMsg, L"SIL.Graphite.FwGrEngine", 0, L"");
		return hr;
	}

	// if we are at the end of the requested range, but the text source still has more text in
	// it, Graphite will determine that the break was bad or okay, even though it broke
	// because there was no more text, so we go ahead and change the reason here to no more text
	if (ichwMin + *pdichwLimSeg == ichwLim && (*pest == kestOkayBreak || *pest == kestBadBreak))
		*pest = kestNoMore;

	bool fError = false;
	std::pair<GlyphIterator, GlyphIterator> pairGfit = pgrseg->glyphs();
	GlyphIterator gfit = pairGfit.first;
	GlyphIterator gfitEnd = pairGfit.second;
	for ( ; gfit != gfitEnd ; ++gfit)
	{
		if ((*gfit).erroneous())
		{
			fError = true;
			break;
		}
	}

	if (fError)
	{
		LgCharRenderProps chrp;
		int ichwMinBogus, ichwLimBogus;
		pgts->GetCharProps(ichwMin, &chrp, &ichwMinBogus, &ichwLimBogus);
		StrUni stuMsg = L"Error in Graphite rendering using font ";
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:67,代码来源:FwGrEngine.cpp


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