• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ nglString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Format

//*********************************************************************
//
// Format. virtual
//
//
bool nuiFormater::Format (double dValue, nglString& rResult) const
{
  // identity (default formater)
  rResult.CFormat ("%.0f", dValue); // i.e., 45.80
  
  return true;
}
开发者ID:YetToCome,项目名称:nui3,代码行数:12,代码来源:nuiFormater.cpp


示例2: if

  nuiAttribute<nuiAnchorType>(const nglString& rName, nuiLayout* pLayout)
  : nuiAttribute<int32>(rName, nuiUnitNone, nuiMakeDelegate(this, &nuiAttribute<nuiAnchorType>::_Get), nuiMakeDelegate(this, &nuiAttribute<nuiAnchorType>::_Set), NUI_INVALID_RANGE),
    mAnchor(rName.Extract(13))
  {
    nuiAttributeBase::SetAsInstanceAttribute(true);

    if (rName.CompareLeft("HAnchorsType_", true) == 0)
    {
      mGetAnchorDelegate = nuiMakeDelegate(pLayout, &nuiLayout::GetHorizontalAnchorType);
      mSetAnchorDelegate = nuiMakeDelegate(pLayout, &nuiLayout::SetHorizontalAnchorType);
    }
    else if (rName.CompareLeft("VAnchorsType_", true) == 0)
    {
      mGetAnchorDelegate = nuiMakeDelegate(pLayout, &nuiLayout::GetVerticalAnchorType);
      mSetAnchorDelegate = nuiMakeDelegate(pLayout, &nuiLayout::SetVerticalAnchorType);
    }
  }
开发者ID:JamesLinus,项目名称:nui3,代码行数:17,代码来源:nuiLayout.cpp


示例3: GetStatusReport

void nuiSocket::GetStatusReport(nglString& rResult)
{
  nglCriticalSectionGuard g(gmCS);

  rResult.Wipe();
  rResult.Add("Total sockets created in session: ").Add(gmSocketCount).AddNewLine();
  rResult.Add("Total current sockets...........: ").Add((int64)gmAllSockets.size()).AddNewLine();
  rResult.AddNewLine();


  for (std::set<nuiSocket*>::const_iterator it = gmAllSockets.begin(); it != gmAllSockets.end(); ++it)
  {
    nuiSocket* pSocket = *it;

    rResult.Add("\t").Add(pSocket->GetDesc()).AddNewLine();
  }
}
开发者ID:,项目名称:,代码行数:17,代码来源:


示例4: LayoutAnchorValue

  LayoutAnchorValue(const nglString& rName, nuiLayout* pLayout)
  : nuiAttribute<float>(rName, nuiUnitNone, nuiMakeDelegate(this, &LayoutAnchorValue::_Get), nuiMakeDelegate(this, &LayoutAnchorValue::_Set), NUI_INVALID_RANGE),
    mAnchor(rName.Extract(9))
  {
    nuiAttributeBase::SetAsInstanceAttribute(true);

    if (rName.CompareLeft("HAnchors_", true) == 0)
    {
      mGetAnchorDelegate = nuiMakeDelegate(pLayout, &nuiLayout::GetHorizontalAnchorPosition);
      mSetAnchorDelegate = nuiMakeDelegate(pLayout, &nuiLayout::SetHorizontalAnchorPosition);
    }
    else if (rName.CompareLeft("VAnchors_", true) == 0)
    {
      mGetAnchorDelegate = nuiMakeDelegate(pLayout, &nuiLayout::GetVerticalAnchorPosition);
      mSetAnchorDelegate = nuiMakeDelegate(pLayout, &nuiLayout::SetVerticalAnchorPosition);
    }
  }
开发者ID:JamesLinus,项目名称:nui3,代码行数:17,代码来源:nuiLayout.cpp


示例5: nuiFileSelectorBase

nuiFileTree::nuiFileTree(const nglPath& rPath, const nglPath& rRootPath, const nglString& rFilter, bool showHiddenFiles)
: nuiFileSelectorBase(), mEventSink(this)
{
  std::list<nglString> filters;
  if (!rFilter.IsNull())
    filters.push_back(rFilter);
  
  Init(rPath, rRootPath, filters, showHiddenFiles);
}
开发者ID:,项目名称:,代码行数:9,代码来源:


示例6: SetState

void nuiStateDecoration::SetState(nuiStateDescription State, const nglString& rDecorationName)
{  
  if (rDecorationName.IsNull())
    return;
  nuiDecoration* pDecoration = nuiDecoration::Get(rDecorationName, true);
  if (!pDecoration)
    return;
  SetState(State, pDecoration);
}
开发者ID:,项目名称:,代码行数:9,代码来源:


示例7: MsgError

bool ProjectGenerator::MsgError(const nglString& error)
{
  nglString msg;
  msg.Format(_T("error %ls"), error.GetChars());
  NGL_OUT(msg);
  nuiMessageBox* pMessageBox = new nuiMessageBox(GetMainWindow(), _T("Project Creator"), msg, eMB_OK);
  pMessageBox->QueryUser();  
  return false;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:9,代码来源:ProjectGenerator.cpp


示例8: nuiLabel

nuiHyperLink::nuiHyperLink(const nglString& rURL, const nglString& rLabel)
  : nuiLabel(rLabel.IsNull() ? rURL : rLabel),
    mURL(rURL)
{
  if (SetObjectClass(_T("nuiHyperLink")))
    InitAttributes();
    
  SetTextColor(nuiColor(_T("nuiHyperLink")));
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:9,代码来源:nuiHyperLink.cpp


示例9: GetRootPart

// Stolen from nglPath!
static int32 GetRootPart(const nglString& rStr)
{
	if (rStr[0] == _T('/'))
	{
		if (rStr[1] != _T('/'))
			return 1;
    
		// //host[/path] (network address)
		// or /volume[/path] (standard unix like path)
		int32 end = rStr.Find(_T('/'), 2);
		return ((end > 0) ? end : rStr.GetLength());
	}
  
  // Find the protocol name:
  int col = rStr.Find(_T("://"), 0, true);
  
  return MIN(col + 3, rStr.GetLength());
}
开发者ID:,项目名称:,代码行数:19,代码来源:


示例10: AddFile

bool nuiZipWriter::AddFile(nglIStream* pStream, const nglString& rPathInZip, const nglString& rComment, bool OwnStream)
{
  NGL_ASSERT(IsValid());
  zip_fileinfo info;
  nglTime tm;
  nglTimeInfo t;
  tm.GetLocalTime(t);
  info.tmz_date.tm_sec  = t.Seconds;
  info.tmz_date.tm_min  = t.Minutes;
  info.tmz_date.tm_hour = t.Hours;
  info.tmz_date.tm_mday = t.Day;
  info.tmz_date.tm_mon  = t.Month;
  info.tmz_date.tm_year = t.Year;

  info.dosDate = 0;

  info.internal_fa = 0;
  info.external_fa = 0;
  
  bool res = zipOpenNewFileInZip(mpZip, rPathInZip.IsNull() ? NULL : rPathInZip.GetStdString().c_str(), &info, NULL, 0, NULL, 0, rComment.IsNull() ? NULL : rComment.GetStdString().c_str(), 0, 0) == Z_OK;
  if (!res)
    return res;

  const uint32 bufsize = 4096;
  uint8 buf[bufsize];
  uint64 todo = pStream->Available();
  uint32 _read = -1;
  while (todo && _read)
  {
    uint32 toread = MIN(todo, bufsize);
    _read = pStream->Read(buf, toread, 1);
    res = zipWriteInFileInZip(mpZip, buf, _read) == Z_OK;
    todo -= _read;

    if (_read != toread)
      return false;
  }

  res = zipCloseFileInZip(mpZip) == Z_OK;

  if (OwnStream)
    delete pStream;
  return res;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:44,代码来源:nglZipFS.cpp


示例11: nuiAudioDevice

nuiAudioDevice_DirectSound::nuiAudioDevice_DirectSound(GUID IGuid, GUID OGuid, const nglString& rInName, const nglString& rOutName, const nglString& rInModule, const nglString& rOutModule)
: nuiAudioDevice()
{
  mInName = rInName;
  mOutName = rOutName;
  if (rOutName.IsEmpty())
    mName = rInName;
  else
    mName = rOutName;

  mManufacturer = rOutModule;
  mIsPresent = false;
  mHasInput = false;
  mHasOutput = false;

  mIDeviceID = IGuid;
  mODeviceID = OGuid;

  mpDirectSound = NULL;
  mpDirectSoundCapture = NULL;

  mAPIName = API_NAME;

  mpRingBuffer = NULL;
  mpInputBuffer = NULL;
  mpOutputBuffer = NULL;

  mpProcessingTh = NULL;
  mpOutputTh = NULL;

  mNotifInputEvent[0] = NULL;
  mNotifInputEvent[1] = NULL;
  mNotifOutputEvent[0] = NULL;
  mNotifOutputEvent[1] = NULL;

  HRESULT hr;
  // Get Input device caps:
  hr = DirectSoundCaptureCreate(&mIDeviceID, &mpDirectSoundCapture, NULL);
  if (hr != S_OK || !mpDirectSoundCapture)
  {
    NGL_LOG(_T("nuiAudioDevice_DirectSound"), NGL_LOG_INFO, _T("constructor ERROR : could not create DirectSoundCapture object!\n"));
  }

  // Get Output device caps:
  hr = DirectSoundCreate(&mODeviceID, &mpDirectSound, NULL);
  if (hr != S_OK || !mpDirectSound)
  {
    NGL_LOG(_T("nuiAudioDevice_DirectSound"), NGL_LOG_ERROR, _T("constructor ERROR : could not create DirectSound object!\n")); // if there is no output, consider the device as not valid
    return;
  }


  Init();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:54,代码来源:nuiAudioDevice_DirectSound.cpp


示例12: nuiDecoration

nuiStateDecoration::nuiStateDecoration(const nglString& rName, const nglString& rUp, const nglString& rDown, const nglString& rHoverOn, const nglString& rDisabled, const nglString& rDisabledSelected)
  : nuiDecoration(rName), mClientRect(0,0,0,0), mUseSourceClientRect(false)
{
  if (SetObjectClass(_T("nuiStateDecoration")))
    InitAttributes();

  if (!rUp.IsNull())
    SetState(nuiStateEnabled  | nuiStateReleased, GetDecoration(rUp));
  if (!rDown.IsNull())
    SetState(nuiStateEnabled  | nuiStatePressed,  GetDecoration(rDown));
  if (!rHoverOn.IsNull())
    SetState(nuiStateEnabled  | nuiStateHoverOn,  GetDecoration(rHoverOn));
  if (!rDisabled.IsNull())
    SetState(nuiStateDisabled | nuiStateReleased, GetDecoration(rDisabled));
  if (!rDisabledSelected.IsNull())
  {
    SetState(nuiStateDisabled | nuiStateSelected, GetDecoration(rDisabledSelected));
    SetState(nuiStateDisabled | nuiStatePressed, GetDecoration(rDisabledSelected));
  }
}
开发者ID:,项目名称:,代码行数:20,代码来源:


示例13: Append

void nglConsole::OnOutput(const nglString& rText)
{
  // 'char' mode : string buffer is considered to use the locale's encoding
  Append(rText.GetChars());

  // Write to the standard win32 console:
#ifdef USE_STANDARD_WIN32_CONSOLE
  unsigned long res = 0;
  WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE),rText.GetChars(),rText.GetLength(),&res,NULL);
#endif

  // I don't care if this is slow, its really mandatory in win32.
  vector<nglString> vec;
  uint ret=rText.Tokenize(vec, _T('\n'));
  for (uint i=0; i<ret; i++)
  {
    OutputDebugString(vec[i].GetChars()); // fixme! to be removed ?
    OutputDebugString(_T("\n"));
  }
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:20,代码来源:nglConsole_WinXX.cpp


示例14: nglPath_IsRO

bool nglPath_IsRO(nglString& rOptions)
{
  std::vector<nglString> tokens;
  std::vector<nglString>::iterator i;

  rOptions.Tokenize(tokens, _T(','));
  for (i = tokens.begin(); i != tokens.end(); i++)
    if ((*i) == _T("ro")) return true;

  return false;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:11,代码来源:nglPath_Unix.cpp


示例15: DumpIncluder

void Generator::DumpIncluder(const nglPath& rootSource, const nglPath& pngSource,const nglPath& codeSource, const nglPath& HincluderPath, const nglPath& CPPincluderPath, nglString& HincluderStr, nglString& CPPincluderStr)
{
  std::list<nglPath> children;
  std::list<nglPath>::iterator it;
  
  pngSource.GetChildren(&children);
  
  for (it = children.begin(); it != children.end(); ++it)
  {
    nglPath child = *it;
    
    if (!child.IsLeaf())
    {
      // recurs.
      DumpIncluder(rootSource, child, codeSource, HincluderPath, CPPincluderPath, HincluderStr, CPPincluderStr);
      continue;
    }
    
    if (child.GetExtension().Compare(_T("png"), false))
      continue;
    
    nglString node = child.GetPathName();
    node.DeleteLeft(rootSource.GetPathName().GetLength()+1);
    node.DeleteRight(nglPath(node).GetExtension().GetLength() +1);
    
    nglPath HdestPath = codeSource + nglPath(node);
    nglPath CPPdestPath = codeSource + nglPath(node);
    HdestPath = nglPath(HdestPath.GetPathName() + _T(".h"));
    CPPdestPath = nglPath(CPPdestPath.GetPathName() + _T(".cpp"));
    
    HdestPath.MakeRelativeTo(HincluderPath.GetParent());
    CPPdestPath.MakeRelativeTo(CPPincluderPath.GetParent());
    
    nglString tmp;
    tmp.Format(_T("#include \"%ls\"\n"), HdestPath.GetChars());
    HincluderStr.Append(tmp);
    tmp.Format(_T("#include \"%ls\"\n"), CPPdestPath.GetChars());
    CPPincluderStr.Append(tmp);
  }
  
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:41,代码来源:Generator.cpp


示例16: GetAbsoluteURL

void nuiHTML::GetAbsoluteURL(const nglString& rBaseURL, nglString& url)
{
  int32 colon = url.Find(':');
  if (colon > 0)
  {
    // complete url link
  }
  else if (url[0] == '/')
  {
    // Site absolute
    int32 col = rBaseURL.Find(_T("://"));
    if (col > 0)
    {
      int32 end = rBaseURL.Find('/', col + 3);
      if (end)
        url = rBaseURL.Extract(0, end) + url;
    }
  }
  else
  {
    // Site relative
    int32 end = rBaseURL.FindLast(_T('/'));
    if (end >= 0)
    {
      url = rBaseURL.Extract(0, end + 1) + url;
    }
    else
    {
      url = rBaseURL + _T("/") + url;
    }
  }
  
  Canonize(url);
}
开发者ID:,项目名称:,代码行数:34,代码来源:


示例17: while

void nuiBindingManager::Dump(nglString& rString) const
{
  //std::map<nglString, nuiFunction*> mFunctions;

  // Dump functions:
  {
    FunctionMap::const_iterator it = mFunctions.begin();
    FunctionMap::const_iterator end = mFunctions.end();
    
    while (it != end)
    {
      std::vector<nglString> argstypes;
      nglString name(it->first);
      nuiTypeContainer* pTypeContainer = it->second;
      pTypeContainer->DumpArgs(argstypes);
      nglString args;
      BuildTypeListString(1, argstypes, args);
      rString.Add(argstypes[0]).Add(" ").Add(name).Add(_T("(")).Add(args).Add(_T(");")).AddNewLine();
      ++it;
    }
  }
  
  
  // Classes:
  TypeMap::const_iterator it = mTypes.begin();
  TypeMap::const_iterator end = mTypes.end();

  while (it != end)
  {
    nuiClass* pClass = it->second;
    nglString name = pClass->GetName();
    nglString classdump;
    pClass->Dump(classdump);

    rString.AddNewLine().AddNewLine().Add(classdump);

    ++it;
  }

}
开发者ID:,项目名称:,代码行数:40,代码来源:


示例18: desc

void nuiLayout::SetConstraint(nuiWidget* pWidget, const nglString& rDescription)
{
  nuiLayoutConstraint constraintH, constraintV;
  int pos = rDescription.Find('/');
  if (pos < 0)
  {
    nglString desc(rDescription);
    desc.Trim();
    constraintH.Set(desc);
  }
  else if (pos == 0)
  {
    nglString desc2 = rDescription.Extract(pos+1, rDescription.GetLength() - (pos + 1));
    desc2.Trim();
    constraintV.Set(desc2);
  }
  else
  {
    nglString desc1 = rDescription.Extract(0, pos);
    nglString desc2 = rDescription.Extract(pos+1, rDescription.GetLength() - (pos + 1));
    desc1.Trim();
    desc2.Trim();
    constraintH.Set(desc1);
    constraintV.Set(desc2);
  }

  SetConstraint(pWidget, constraintH, constraintV);
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:28,代码来源:nuiLayout.cpp


示例19: GetHistory

int nglConsole::GetHistory (list<const nglString*>& rMatches, nglString& rFilter, bool IsCaseSensitive)
{
  #if NGL_DISABLE_CONSOLE
  return 0;
  #else

  int count = 0;
  list<nglString*>::reverse_iterator h_entry;
  list<nglString*>::reverse_iterator h_begin = mHistory.rbegin();

  rMatches.clear();
  int size = rFilter.GetLength();
  for (h_entry = mHistory.rend(); h_entry != h_begin; h_entry--)
    if (!rFilter.Compare(**h_entry, 0, size, IsCaseSensitive))
    {
      rMatches.push_front(*h_entry);
      count++;
    }

  return count;
  #endif
}
开发者ID:,项目名称:,代码行数:22,代码来源:


示例20: SetClipboard

bool nglKernel::SetClipboard(const nglString& rString)
{
  if (OpenClipboard(mHWnd))
  {
    EmptyClipboard();

    HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, rString.GetLength()+1); 
    if (hglbCopy == NULL) 
    { 
      CloseClipboard(); 
      return false; 
    } 

    char* lptstrCopy = (char*)GlobalLock(hglbCopy); 
    memcpy(lptstrCopy, rString.GetChars(), rString.GetLength()+1); 
    GlobalUnlock(hglbCopy); 

    SetClipboardData(CF_TEXT, hglbCopy); 
    CloseClipboard();
    return true;
  }
  return false;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:23,代码来源:nglKernel_WinXX.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ nlopt_opt类代码示例发布时间:2022-05-31
下一篇:
C++ nglPath类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap