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


C++ WString::Cat方法代码示例

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


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

示例1: sMergeWith

static void sMergeWith(WString& dest, const wchar *delim, const WString& s)
{
	if(s.GetLength()) {
		if(dest.GetCount())
			dest.Cat(delim);
		dest.Cat(s);
	}
}
开发者ID:koz4k,项目名称:soccer,代码行数:8,代码来源:SplitMerge.cpp

示例2: GetText

WString RichPara::GetText() const
{
	WString r;
	for(int i = 0; i < part.GetCount(); i++)
		if(part[i].IsText())
			r.Cat(part[i].text);
		else
			r.Cat(127);
	return r;
}
开发者ID:pedia,项目名称:raidget,代码行数:10,代码来源:ParaData.cpp

示例3: Cat

void RichQtfParser::Cat(int chr)
{
	if(accesskey && ToUpper(ToAscii(chr)) == LOBYTE(accesskey)) {
		Flush();
		format.Underline(!format.IsUnderline());
		text.Cat(chr);
		Flush();
		format.Underline(!format.IsUnderline());
		accesskey = 0;
	}
	else if(chr >= ' ') {
		text.Cat(chr);
	}
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:14,代码来源:ParseQtf.cpp

示例4: Copy

void RichTextView::Copy()
{
	if(anchor == cursor)
		WriteClipboardUnicodeText(text.GetPlainText());
	else {
		RefreshSel();
		WString h = text.GetPlainText(false).Mid(sell, selh - sell);
		WString r;
		for(const wchar *s = ~h; s < h.End(); s++) {
			if(*s == '\n')
				r.Cat('\r');
			r.Cat(*s);
		}
		WriteClipboardUnicodeText(r);
	}
}
开发者ID:pedia,项目名称:raidget,代码行数:16,代码来源:RichTextView.cpp

示例5: SaveFormat

void RichTxt::SaveFormat(Formating& r, int p1, int p2, const RichStyles& style) const
{
	Array<RichObject> dummy;
	for(int i = p1; i <= p2; i++)
		if(IsTable(i)) {
			const RichTable& tab = part[i].Get<RichTable>();
			for(int i = 0; i < tab.GetRows(); i++)
				for(int j = 0; j < tab.GetColumns(); j++)
					if(tab(i, j)) {
						const RichTxt& txt = tab[i][j].text;
						txt.SaveFormat(r, 0, txt.GetPartCount() - 1, style);
					}
		}
		else {
			RichPara pa = Get(i, style);
			for(int i = 0; i < pa.GetCount(); i++) {
				RichPara::Part& p = pa[i];
				int q = p.GetLength();
				p.field = Id();
				p.object = RichObject();
				WString h;
				while(q) {
					int c = min(q, 50000);
					h.Cat(c + 32);
					q -= c;
				}
				p.text = h;
			}
			r.styleid.Add(pa.format.styleid);
			r.format.Add(pa.Pack(GetStyle(style, pa.format.styleid).format, dummy));
		}
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:32,代码来源:TxtOp.cpp

示例6: GetClipFiles

Vector<String> GetClipFiles(const String& data)
{
	GuiLock __;
	Vector<String> f;
	if((unsigned)data.GetCount() < sizeof(sDROPFILES) + 2)
		return f;
	const sDROPFILES *df = (const sDROPFILES *)~data;
	const char *s = ((const char *)df + df->offset);
	if(df->unicode) {
		const wchar *ws = (wchar *)s;
		while(*ws) {
			WString fn;
			while(*ws)
				fn.Cat(*ws++);
			f.Add(fn.ToString());
			ws++;
		}
	}
	else
		while(*s) {
			String fn;
			while(*s)
				fn.Cat(*s++);
			f.Add(fn.ToString());
			s++;
		}
	return f;
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:28,代码来源:Win32Clip.cpp

示例7: WStringTutorial

void WStringTutorial()
{
	/// .WString

	/// String works with 8 bit characters. For 16-bit character encoding use `WString`. Both
	/// classes are closely related and share most of interface methods. U++ also provides
	/// conversions between `String` and `WString` and you can also use 8 bit string literals with
	/// `WString`. Conversion is ruled by current default character set. Default value of default
	/// character set is `CHARSET_UTF8`. This conversion is also used in `WString::ToString`,
	/// e.g. when putting `WString` to log:

	WString x = "characters 280-300: "; // you can assign 8-bit character literal to WString
	for(int i = 280; i < 300; i++)
		x.Cat(i);
	
	DUMP(x);
	
	/// `ToString` converts `WString` to `String`:

	String y = x.ToString();
	DUMP(y);

	/// `ToWString` converts `String` to `WString`:

	y.Cat(" (appended)"); // you can use 8-bit character literals in most WString operations
	x = y.ToWString();
	
	DUMP(x);
	
	///
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:31,代码来源:WString.cpp

示例8: CopyRectSelection

WString LineEdit::CopyRectSelection()
{
	WString txt;
	Rect rect = GetRectSelection();
	for(int i = rect.top; i <= rect.bottom; i++) {
		int l, h;
		CacheLinePos(i);
		int pos = GetPos(i);
		GetRectSelection(rect, i, l, h);
		txt.Cat(GetWLine(i).Mid(l - pos, h - l));
#ifdef PLATFORM_WIN32
		txt.Cat('\r');
#endif
		txt.Cat('\n');
	}
	return txt;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:17,代码来源:LineEdit.cpp

示例9: Paint

	virtual void Paint(Draw& w) {
		WString h = "Hello ěščřžýáíéúů ";
		for(int i = 0; i < 10; i++)
			h.Cat(20000 + i);
		w.DrawRect(GetSize(), White());
		Font fnt;
		fnt.FaceName("Bitstream Vera Sans Mono");
		fnt.Height(13);
		DoDrawText(w, 100, 100, 0, h, fnt, Black(), h.GetCount(), NULL);
		DoDrawText(w, 100, 300, 300, h, fnt, Black(), h.GetCount(), NULL);
	}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:11,代码来源:main.cpp

示例10: RemoveRectSelection

int LineEdit::RemoveRectSelection()
{
	Rect rect = GetRectSelection();
	WString txt;
	for(int i = rect.top; i <= rect.bottom; i++) {
		int l, h;
		CacheLinePos(i);
		GetRectSelection(rect, i, l, h);
		WString s = GetWLine(i);
		s.Remove(l - GetPos(i), h - l);
		txt.Cat(s);
		txt.Cat('\n');
	}
	int l = GetPos(rect.top);
	int h = GetPos(rect.bottom) + GetLineLength(rect.bottom);
	if(h < GetLength())
		h++;
	Remove(l, h - l);
	Insert(l, txt);
	return GetGPos(rect.bottom, rect.left);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:21,代码来源:LineEdit.cpp

示例11: GetPlainText

WString RichTxt::GetPlainText() const {
	WString clip;
	for(int pi = 0; pi < GetPartCount(); pi++) {
		if(pi) {
			clip.Cat('\r');
			clip.Cat('\n');
		}
		if(IsTable(pi)) {
			const RichTable& tab = part[pi].Get<RichTable>();
			for(int i = 0; i < tab.GetRows(); i++)
				for(int j = 0; j < tab.GetColumns(); j++)
					if(tab(i, j)) {
						if(i || j) {
							clip.Cat('\r');
							clip.Cat('\n');
						}
						clip << tab[i][j].text.GetPlainText();
					}
		}
		else
			clip.Cat(Get(pi, RichStyle::GetDefault()).GetText());
	}
	return clip;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:24,代码来源:TxtOp.cpp

示例12: if

Vector<WString> SplitCmdLine__(const char *cmd)
{
	Vector<WString> out;
	while(*cmd)
		if((byte)*cmd <= ' ')
			cmd++;
		else if(*cmd == '\"') {
			WString quoted;
			while(*++cmd && (*cmd != '\"' || *++cmd == '\"'))
				quoted.Cat(FromSystemCharset(String(cmd, 1)).ToWString());
			out.Add(quoted);
		}
		else {
			const char *begin = cmd;
			while((byte)*cmd > ' ')
				cmd++;
			out.Add(String(begin, cmd).ToWString());
		}
	return out;
}
开发者ID:koz4k,项目名称:soccer,代码行数:20,代码来源:Win32Wnd.cpp

示例13: Parse


//.........这里部分代码省略.........
				case '{': {
						String cs = GetText('}');
						if(cs.GetLength() == 1) {
							int c = *cs;
							if(c == '_')
								format.charset = CHARSET_UTF8;
							if(c >= '0' && c <= '8')
								format.charset = c - '0' + CHARSET_WIN1250;
							if(c >= 'A' && c <= 'Z')
								format.charset = c - '0' + CHARSET_ISO8859_1;
						}
						else {
							for(int i = 0; i < CharsetCount(); i++)
								if(stricmp(CharsetName(i), cs) == 0) {
									format.charset = i;
									break;
								}
						}
						break;
					}
				case '%': {
						String h;
						if(*term == '-') {
							format.language = 0;
							term++;
						}
						else
						if(*term == '%') {
							format.language = LNG_ENGLISH;
							term++;
						}
						else {
							while(*term && h.GetLength() < 5)
								h.Cat(*term++);
							format.language = LNGFromText(h);
						}
						break;
					}
				case 'g':
					format.Face(Font::STDFONT);
					format.Height(GetRichTextScreenStdFontHeight());
					break;
				default:
					if(c >= '0' && c <= '9') {
						format.Height(QTFFontHeight[c - '0']);
						break;
					}
					switch(c) {
					case ':': format.label = GetText(':'); break;
					case '<': format.align = ALIGN_LEFT; break;
					case '>': format.align = ALIGN_RIGHT; break;
					case '=': format.align = ALIGN_CENTER; break;
					case '#': format.align = ALIGN_JUSTIFY; break;
					case 'l': format.lm = GetNumber(); break;
					case 'r': format.rm = GetNumber(); break;
					case 'i': format.indent = GetNumber(); break;
					case 'b': format.before = GetNumber(); break;
					case 'a': format.after = GetNumber(); break;
					case 'P': format.newpage = !format.newpage; break;
					case 'k': format.keep = !format.keep; break;
					case 'K': format.keepnext = !format.keepnext; break;
					case 'H': format.ruler = GetNumber(); break;
					case 'h': format.rulerink = GetColor(); break;
					case 'L': format.rulerstyle = GetNumber(); break;
					case 'Q': format.orphan = !format.orphan; break;
					case 'n': format.before_number = GetText(';'); break;
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:67,代码来源:ParseQtf.cpp


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