本文整理汇总了C++中StringStream::Open方法的典型用法代码示例。如果您正苦于以下问题:C++ StringStream::Open方法的具体用法?C++ StringStream::Open怎么用?C++ StringStream::Open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringStream
的用法示例。
在下文中一共展示了StringStream::Open方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Open
void cDrawRasterData::Open(const String& data, int _cx, int cy)
{
cx = _cx;
ss.Open(data);
raster = StreamRaster::OpenAny(ss);
if(raster)
si.Create(Size(cx, cy), *raster, raster->GetSize());
}
示例2: UpdateChildCount
void FormEdit::UpdateChildCount(int count)
{
for (int i = 0; i < _Ctrls.GetCount(); ++i)
_CtrlContainer.RemoveChild(&_Ctrls[i]);
_Ctrls.Clear();
_ItemList.Clear();
_Temporaries.Clear();
if (!_View.IsLayout())
{
UpdateItemList();
return;
}
// if (_ViewMode == VIEW_MODE_WIREFRAME)
// return;
for (int i = 0; i < count; ++i)
{
if (!_View.GetObject(i))
continue;
String type = (*_View.GetObjects())[i].Get("Type");
Font font = _View.GetFont();
int h = _View.ZoomY((*_View.GetObjects())[i].GetNumber("Font.Height"));
if (h != 0) font.Height(h);
if (font.GetHeight() == 0) font.Height(StdFont().GetHeight());
_ItemList.AddRow(type, (*_View.GetObjects())[i].Get("Variable"));
if ((*_View.GetObjects())[i].GetBool("OutlineDraw", false)
&& _ViewMode != VIEW_MODE_AS_IS)
{
if (_ViewMode != VIEW_MODE_WIREFRAME)
_CtrlContainer.Add( _Ctrls.Create<StaticRect>() );
}
else if (type == "Button")
{
Button* b = &_Ctrls.Create<Button>();
b->SetFont(font);
if (_ViewMode == VIEW_MODE_AS_IS)
b->SetLabel((*_View.GetObjects())[i].Get("Label"));
if (_ViewMode != VIEW_MODE_WIREFRAME)
_CtrlContainer.Add( b->NoWantFocus() );
}
else if (type == "DropDate")
{
DropDate *b = &_Ctrls.Create<DropDate>();
b->SetFont(font);
if (_ViewMode != VIEW_MODE_WIREFRAME)
_CtrlContainer.Add( b->NoWantFocus() );
}
else if (type == "GridCtrl")
{
GridCtrl *b = &_Ctrls.Create<GridCtrl>();
// b->SetFont(font); TODO
#ifdef PLATFORM_WIN32
b->Chameleon();
#endif
String src = (*_View.GetObjects())[i].Get("Grid.Columns");
ReplaceString(src, ";", "\r\n");
StringStream s;
s.Open(src);
IniFile f;
f.Load(s);
Vector<String> names = f.EnumNames("Columns");
for (int j = 0; j < names.GetCount(); ++j)
{
int n = ScanInt(names[j]);
Vector<String> values = f.GetArray("Columns", names[j]);
if (values.GetCount() != 3)
continue;
if (values[1] == "Left") b->AddColumn(values[0]).HeaderAlignCenterLeft();
else if (values[1] == "Right") b->AddColumn(values[0]).HeaderAlignCenterRight();
else b->AddColumn(values[0]).HeaderAlignCenter();
}
if (_ViewMode != VIEW_MODE_WIREFRAME)
_CtrlContainer.Add( b->NoWantFocus() );
}
else if (type == "EditField")
{
EditField *b = &_Ctrls.Create<EditField>();
b->SetFont(font);
if (_ViewMode == VIEW_MODE_AS_IS)
b->SetText((*_View.GetObjects())[i].Get("DefaultData"));
if (_ViewMode != VIEW_MODE_WIREFRAME)
_CtrlContainer.Add( b->NoWantFocus() );
}
else if (type == "EditInt")
{
EditInt *b = &_Ctrls.Create<EditInt>();
b->SetFont(font);
//.........这里部分代码省略.........