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


C++ nglPath::GetChars方法代码示例

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


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

示例1: CopyDirectory

bool ProjectGenerator::CopyDirectory(const nglPath& targetPath, const nglPath& srcpath)
{
  // create folder
  if (!targetPath.Create())
  {
    nglString msg;
    msg.Format(_T("creating target folder '%ls'"), targetPath.GetChars());
    return MsgError(msg);
  }
  
  
  std::list<nglPath> children;
  srcpath.GetChildren(&children);
  std::list<nglPath>::iterator it;
  for (it = children.begin(); it != children.end(); ++it)
  {
    const nglPath& srcpath = *it;
    
    if (!srcpath.IsLeaf())
      continue;
    
    nglPath dstpath = targetPath;
    dstpath += srcpath.GetNodeName();
    
    nglString contents;
    
    nglIStream* piFile = srcpath.OpenRead();
    if (!piFile)
    {
      nglString msg;
      msg.Format(_T("opening for reading input file '%ls'"), srcpath.GetChars());
      return MsgError(msg);
    }
    
    nglOStream* poFile = dstpath.OpenWrite(false);
    if (!poFile)
    {
      nglString msg;
      msg.Format(_T("opening for writing output file '%ls'"), dstpath.GetChars());
      return MsgError(msg);
    }
    
    piFile->PipeTo(*poFile);
    delete poFile;
    delete piFile;
    
    NGL_OUT(_T("nui project generator : created file '%ls'\n"), dstpath.GetChars());
  }
  
  return true;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:51,代码来源:ProjectGenerator.cpp

示例2: LoadCSS

bool MainWindow::LoadCSS(const nglPath& rPath)
{
  NGL_OUT("MainWindow::LoadCSS");
  nglIStream* pF = rPath.OpenRead();
  if (!pF)
  {
    NGL_OUT(_T("Unable to open CSS source file '%ls'\n"), rPath.GetChars());
    return false;
  }
  
  nuiCSS* pCSS = new nuiCSS();
  bool res = pCSS->Load(*pF, rPath);
  delete pF;
  
  if (res)
  {
    nuiMainWindow::SetCSS(pCSS);
    NGL_OUT("MainWindow::LoadCSS OK");
    return true;
  }
  
  NGL_OUT(_T("%ls\n"), pCSS->GetErrorString().GetChars());
  
  delete pCSS;
  NGL_OUT("MainWindow::LoadCSS ERROR");
  return false;
}
开发者ID:changbiao,项目名称:nui3,代码行数:27,代码来源:MainWindow.cpp

示例3: GenerateFile

bool ProjectGenerator::GenerateFile(const nglPath& src, const nglPath& dst)
{
  uint32 srcsize = (uint32)src.GetSize();
  
  nglIStream* pFile = src.OpenRead();
  if (!pFile)
  {
    nglString msg;
    msg.Format(_T("reading input file '%ls'"), src.GetChars());
    return MsgError(msg);
  }

  char* str = new char[srcsize + 1];
  pFile->Read(str, srcsize, 1);
  str[srcsize] = 0;
  delete pFile;
  
  nglString contents(str);
  contents.Replace(_T("TemplateApp"), mProjectName);
  contents.Replace(_T("../../../nui3"), mNuiRelativeSource.GetPathName());

  
  nglOStream* poFile = dst.OpenWrite(false);
  if (!poFile)
  {
    nglString msg;
    msg.Format(_T("writing output file '%ls'"), dst.GetChars());
    return MsgError(msg);
  }

  char* ptr = contents.Export();
  
  poFile->Write(ptr, contents.GetLength(), 1);
  delete poFile;
  if (ptr)
    free(ptr);

  NGL_OUT(_T("nui project generator : generated '%ls'\n"), dst.GetChars());
  return true;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:40,代码来源:ProjectGenerator.cpp

示例4: InstallApplication

bool iOSDevice::InstallApplication(const nglPath& rPath)
{
  AMDeviceConnect(mpDevice);
  bool paired = AMDeviceIsPaired(mpDevice);
  bool validated = AMDeviceValidatePairing(mpDevice) == 0;
  bool sessionstarted = AMDeviceStartSession(mpDevice) == 0;

  //if (paired && validated && sessionstarted)
  {
    CFStringRef path = CFStringCreateWithCString(NULL, rPath.GetChars(), kCFStringEncodingUTF8);
    CFURLRef relative_url = CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, false);
    CFURLRef url = CFURLCopyAbsoluteURL(relative_url);

    CFRelease(relative_url);

    service_conn_t afcFd;
    bool servicestarted = (AMDeviceStartService(mpDevice, CFSTR("com.apple.afc"), &afcFd, NULL) == 0);
    (AMDeviceStopSession(mpDevice) == 0);
    (AMDeviceDisconnect(mpDevice) == 0);
    (AMDeviceTransferApplication(afcFd, path, NULL, &iOSDevice::TransferCallback, (void*)this) == 0);

    close(afcFd);

    CFStringRef keys[] = { CFSTR("PackageType") };
    CFStringRef values[] = { CFSTR("Developer") };
    CFDictionaryRef options = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);

    AMDeviceConnect(mpDevice);
    (AMDeviceIsPaired(mpDevice));
    (AMDeviceValidatePairing(mpDevice) == 0);
    (AMDeviceStartSession(mpDevice) == 0);

    service_conn_t installFd;
    (AMDeviceStartService(mpDevice, CFSTR("com.apple.mobile.installation_proxy"), &installFd, NULL) == 0);

    (AMDeviceStopSession(mpDevice) == 0);
    (AMDeviceDisconnect(mpDevice) == 0);

    mach_error_t result = AMDeviceInstallApplication(installFd, path, options, InstallCallback, (void*)this);
    if (result != 0)
    {
      printf("AMDeviceInstallApplication failed: %d\n", result);
      nglString str;
      str.CFormat("AMDeviceInstallApplication failed: %d", result);
      InstallationProgress(0, str);
      return false;
    }

    close(installFd);

    CFRelease(path);
    CFRelease(options);

    NGL_OUT("[100%%] Installed package %s\n", rPath.GetChars());
    nglString str;
    str.CFormat("Installed package %s", rPath.GetChars());
    InstallationProgress(100, str);
    return true;
  }

  return false;
}
开发者ID:OleksiyA,项目名称:xspray,代码行数:62,代码来源:iOSRemoteDebug.cpp

示例5: SetTexturePath

void nuiImageDecoration::SetTexturePath(nglPath path)
{
  SetProperty(_T("Texture"), path.GetPathName());
  nuiTexture* pOld = mpTexture;
  mpTexture = nuiTexture::GetTexture(path);
  if (!mpTexture || !mpTexture->IsValid())
  {
    NGL_OUT(_T("nuiImageDecoration::SetTexturePath warning : could not load graphic resource '%ls'\n"), path.GetChars());
    return;
  }
  
  if (GetSourceClientRect() == nuiRect(0,0,0,0))
    SetSourceClientRect(nuiRect(0, 0, mpTexture->GetWidth(), mpTexture->GetHeight()));
  if (pOld)
    pOld->Release();
  
  SetRepeatX(mRepeatX);
  SetRepeatY(mRepeatY);
  
  Changed();
}
开发者ID:jpastuszek,项目名称:nui3,代码行数:21,代码来源:nuiImageDecoration.cpp

示例6: SetTexturePath

void nuiFrame::SetTexturePath(const nglPath& rPath)
{
  mTexturePath = rPath;
  nuiTexture* pOld = mpTexture;
  mpTexture = nuiTexture::GetTexture(rPath);

  if (!mpTexture || !mpTexture->IsValid())
  {
    NGL_OUT(_T("nuiFrame::SetTexturePath warning : could not load graphic resource '%ls'\n"), rPath.GetChars());
    return;
  }

  if (GetSourceClientRect() == nuiRect(0,0,0,0))
    SetSourceClientRect(nuiRect(0, 0, mpTexture->GetWidth(), mpTexture->GetHeight()));
  if (pOld)
    pOld->Release();
    
  if (mInterpolated)
  {
    mpTexture->SetMinFilter(GL_LINEAR);
    mpTexture->SetMagFilter(GL_LINEAR);
  }
  else
  {
    mpTexture->SetMinFilter(GL_NEAREST);
    mpTexture->SetMagFilter(GL_NEAREST);
  }
  Changed();
}
开发者ID:jpastuszek,项目名称:nui3,代码行数:29,代码来源:nuiFrame.cpp


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