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


C++ PathName::Get方法代码示例

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


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

示例1: return

bool
File::Exists (/*[in]*/ const PathName & path)
{
  struct stat statbuf;
  if (stat(path.Get(), &statbuf) == 0)
    {
      if (S_ISDIR(statbuf.st_mode) != 0)
	{
	  SessionImpl::theSession->trace_access->WriteFormattedLine
	    ("core",
	     T_("%s is a directory"),
	     Q_(path));
	  return (false);
	}
      SessionImpl::theSession->trace_access->WriteFormattedLine
	("core",
	 T_("accessing file %s: OK"),
	 Q_(path));
      return (true);
    }
  int error = errno;
  if (error != ENOENT)
    {
      FATAL_CRT_ERROR ("stat", path.Get());
    }
  SessionImpl::theSession->trace_access->WriteFormattedLine
    ("core",
     T_("accessing file %s: NOK"),
     Q_(path));
  return (false);
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:31,代码来源:unxFile.cpp

示例2: trigger

bool
SessionImpl::CheckCandidate (/*[in,out]*/ PathName &	path,
			     /*[in]*/ const char *	lpszFileInfo)
{
  bool found = false;
  if (IsMpmFile(path.Get()))
  {
    PathName trigger (Utils::GetRelativizedPath(path.Get(), MPM_ROOT_PATH));
    PathName installRoot;
    if (lpszFileInfo != 0 && pInstallPackageCallback != 0
	&& pInstallPackageCallback->InstallPackage(
	      lpszFileInfo, trigger.Get(), installRoot))
    {
      PathName temp = installRoot;
      temp += path.Get() + MPM_ROOT_PATH_LEN;
      if (File::Exists(temp))
      {
	path = temp;
	found = true;
      }
    }
  }
  else
  {
    found = File::Exists(path);
  }
  return (found);
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:28,代码来源:findfile.cpp

示例3:

void
Directory::SetCurrentDirectory (/*[in]*/ const PathName &	path)
{
  if (chdir(path.Get()) != 0)
    {
      FATAL_CRT_ERROR ("chdir", path.Get());
    }
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:8,代码来源:unxFile.cpp

示例4: throw

int
main (/*[in]*/ int		argc,
      /*[in]*/ char **	argv)
{
  try
    {
      SessionWrapper pSession;
      Session::InitInfo initInfo;
      initInfo.SetProgramInvocationName (argv[0]);
      pSession.CreateSession (initInfo);
      if (argc != 2)
	{
	  tcerr << T_("Usage: mkocp OCPFILE") << endl;
	  throw (1);
	}
      PathName otp2ocp;
      if (! pSession->FindFile(T_("otp2ocp"), FileType::EXE, otp2ocp))
	{
	  tcerr << T_("mkocp: otp2ocp executable could not be found.") << endl;
	  throw (1);
	}
      char szFileName[BufferSizes::MaxPath];
      char szExt[BufferSizes::MaxPath];
      PathName::Split (argv[1],
		       0, 0,
		       szFileName, BufferSizes::MaxPath,
		       szExt, BufferSizes::MaxPath);
      PathName outputName;
      if (PathName::Compare(szExt, ".ocp") == 0)
	{
	  outputName = szFileName;
	}
      else
	{
	  outputName.Set (0, szFileName, szExt);
	}
      CommandLineBuilder commandLine;
      commandLine.AppendArgument (outputName.Get());
      Process::Run (otp2ocp.Get(), commandLine.Get());
      tcout << outputName.Get() << ".ocp" << endl;
      return (0);
    }
  catch (const MiKTeXException & e)
    {
      Utils::PrintException (e);
      return (1);
    }
  catch (const exception & e)
    {
      Utils::PrintException (e);
      return (1);
    }
  catch (int exitCode)
    {
      return (exitCode);
    }
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:57,代码来源:mkocp.cpp

示例5: pathRelNotes

BOOL
FinishPage::OnWizardFinish ()
{
  BOOL ret = CPropertyPage::OnWizardFinish();
  if (ret)
    {
      try
	{
	  CWnd * pWnd = GetDlgItem(IDC_VIEW_RELNOTES);
	  if (pWnd == 0)
	    {
	      UNEXPECTED_CONDITION ("FinishPage::OnWizardFinish");
	    }
	  if (viewReleaseNotes == BST_CHECKED)
	    {
	      if (pSheet->GetErrorFlag())
		{
		  theApp.showLogFileOnExit = true;
		}
	      else
		{
		  PathName pathRelNotes (theApp.GetInstallRoot(),
					 MIKTEX_PATH_RELNOTES_HTML);
		  if (ShellExecuteW(0,
				    L"open",
				    UW_(pathRelNotes.Get()),
				    0,
				    0,
				    SW_SHOWNORMAL)
		      <= reinterpret_cast<HINSTANCE>(32))
		    {
		      FATAL_MIKTEX_ERROR ("FinishPage::OnWizardFinish",
				  T_("The file could not be opened."),
					  pathRelNotes.Get());
		    }
		}
	    }
	}
      catch (const MiKTeXException & e)
	{
	  pSheet->ReportError (e);
	  ret = FALSE;
	}
      catch (const exception & e)
	{
	  pSheet->ReportError (e);
	  ret = FALSE;
	}
    }
  return (ret);
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:51,代码来源:FinishPage.cpp

示例6: pLister

void
Directory::Delete (/*[in]*/ const PathName &	path,
                            /*[in]*/ bool		recursive)
{
    if (recursive)
    {
        PathNameArray vecFiles;
        vecFiles.reserve (10);

        PathNameArray vecDirectories;
        vecDirectories.reserve (10);

        auto_ptr<DirectoryLister> pLister (DirectoryLister::Open(path));
        DirectoryEntry entry;
        while (pLister->GetNext(entry))
        {
            if (entry.isDirectory)
            {
                vecDirectories.push_back (PathName(path.Get(),
                                                   entry.name.c_str(),
                                                   0));
            }
            else
            {
                vecFiles.push_back (PathName(path.Get(), entry.name.c_str(), 0));
            }
        }
        pLister->Close ();

        PathNameArray::const_iterator it;

        // remove files
        for (it = vecFiles.begin(); it != vecFiles.end(); ++ it)
        {
            File::Delete (*it, true);
        }

        // remove directories recursively
        for (it = vecDirectories.begin(); it != vecDirectories.end(); ++ it)
        {
            // <recursivecall>
            Delete (*it, true);
            // </recursivecall>
        }
    }

    // remove this directory
    Directory::Delete (path);
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:49,代码来源:files.cpp

示例7: attributes

void
File::SetNativeAttributes (/*[in]*/ const PathName &	path,
			   /*[in]*/ unsigned long	nativeAttributes)
{
  SessionImpl::theSession->trace_files->WriteFormattedLine
    ("core",
     T_("setting new attributes (%x) on %s"),
     static_cast<int>(nativeAttributes),
     Q_(path));

  if (chmod(path.Get(), static_cast<mode_t>(nativeAttributes)) != 0)
    {
      FATAL_CRT_ERROR ("chmod", path.Get());
    }
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:15,代码来源:unxFile.cpp

示例8: return

miktex_find_input_file (/*[in]*/ const char *	lpszApplicationName,
			/*[in]*/ const char *	lpszFileName,
			/*[out]*/ char *	lpszPath)
{
  C_FUNC_BEGIN ();
  MIKTEX_ASSERT_STRING_OR_NIL (lpszApplicationName);
  MIKTEX_ASSERT_STRING (lpszFileName);
  MIKTEX_ASSERT_PATH_BUFFER (lpszPath);
  PathName temp;
  if (! SessionImpl::GetSession()->FindFile(lpszFileName,
					    FileType::None,
					    temp))
    {
      if (lpszApplicationName == 0)
	{
	  return (0);
	}
      string searchPath = CURRENT_DIRECTORY;
      searchPath += PATH_DELIMITER;
      searchPath += TEXMF_PLACEHOLDER;
      searchPath += MIKTEX_PATH_DIRECTORY_DELIMITER_STRING;
      searchPath += lpszApplicationName;
      searchPath += RECURSION_INDICATOR;
      if (! SessionImpl::GetSession()->FindFile(lpszFileName,
						searchPath.c_str(),
						temp))
	{
	  return (0);
	}
    }
  Utils::CopyString (lpszPath, BufferSizes::MaxPath, temp.Get());
  return (1);
  C_FUNC_END ();
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:34,代码来源:findfile.cpp

示例9: if

void
PostScript::DoSpecial (/*[in]*/ DvipsSpecial * pdvipsspecial)
{
  Execute ("%d %d a\n",
    pdvipsspecial->GetX() - pDviImpl->GetResolution(),
    pdvipsspecial->GetY() - pDviImpl->GetResolution());
  if (pdvipsspecial->GetProtection())
  {
    Execute ("@beginspecial\n");
    Execute ("@setspecial\n");
  }
  if (pdvipsspecial->GetString())
  {
    Execute ("%s\n", pdvipsspecial->GetString());
  }
  else if (pdvipsspecial->GetFileName())
  {
    PathName filename;
    if (! FindGraphicsFile(pdvipsspecial->GetFileName(), filename))
    {
      FATAL_MIKTEX_ERROR ("PostScript::DoSpecial",
	T_("Cannot find file."), pdvipsspecial->GetFileName());
    }
    ExecuteEncapsulatedPostScript (filename.Get());
  }
  if (pdvipsspecial->GetProtection())
  {
    Execute("@endspecial\n");
  }
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:30,代码来源:PostScript.cpp

示例10: return

bool
MakeXEmacsCommandLine (/*[out]*/ string &	program,
		       /*[out]*/ string &	arguments)
{
  PathName emacsDir;
  if (! ReadPath(
    HKEY_LOCAL_MACHINE,
    L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\xemacs.exe",
    L"Path",
    emacsDir))
  {
    return (false);
  }
  PathName pathEmacs;
  pathEmacs = emacsDir;
  pathEmacs += "runemacs.exe";
  if (! File::Exists(pathEmacs))
  {
    pathEmacs = emacsDir;
    pathEmacs += "xemacs.exe";
    if (! File::Exists(pathEmacs))
    {
      return (false);
    }
  }
  program = pathEmacs.Get();
  arguments = "+%l \"%f\"";
  return (true);
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:29,代码来源:InverseSearchOptionsPage.cpp

示例11: hFile

Dib::Dib (/*[in]*/ const PathName & path)
  : hFile (INVALID_HANDLE_VALUE),
    hMap (0),
    pBitmapFileHeader (0)
{
  AttachFile (path.Get());
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:7,代码来源:Dib.cpp

示例12: destDir

void
File::Move (/*[in]*/ const PathName &	source,
	    /*[in]*/ const PathName &	dest)
{
  struct stat sourceStat;
  if (stat(source.Get(), &sourceStat) != 0)
    {
      FATAL_CRT_ERROR ("stat", source.Get());
    }

  PathName destDir (dest);
  destDir.MakeAbsolute ();
  destDir.RemoveFileSpec ();
  struct stat destStat;
  if (stat(destDir.Get(), &destStat) != 0)
    {
      FATAL_CRT_ERROR ("stat", destDir.Get());
    }
  
  bool sameDevice = (sourceStat.st_dev == destStat.st_dev);

  if (sameDevice)
    {
      SessionImpl::theSession->trace_files->WriteFormattedLine
	("core",
	 T_("renaming %s to %s"),
	 Q_(source),
	 Q_(dest));
      if (rename(source.Get(), dest.Get()) != 0)
	{
	  FATAL_CRT_ERROR ("rename", source.Get());
	}
    }
  else
    {
      Copy (source, dest);
      try
	{
	  Delete (source);
	}
      catch (const MiKTeXException &)
	{
	  try
	    {
	      if (Exists(source))
		{
		  Delete (dest);
		}
	    }
	  catch (const MiKTeXException &)
	    {
	    }
	  throw;
	}
    }
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:56,代码来源:unxFile.cpp

示例13: ExecuteBatch

void
PostScript::SendHeader (/*[in]*/ const char * lpszHeaderName)
{
  PathName fileName;
  if (! SessionWrapper(true)->FindFile(lpszHeaderName, FileType::PSHEADER, fileName))
  {
    FATAL_MIKTEX_ERROR (T_("PostScript::SendHeader"),
      T_("Cannot find PostScript header file."), lpszHeaderName);
  }
  tracePS->WriteFormattedLine ("libdvi", T_("Sending %s..."), Q_(fileName));
  ExecuteBatch (fileName.Get());
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:12,代码来源:PostScript.cpp

示例14:

void
Process::Run (/*[in]*/ const PathName &		fileName,
	      /*[in]*/ const char *		lpszArguments,
	      /*[int]*/ IRunProcessCallback *	pCallback)
{
  if (! Run(fileName, lpszArguments, pCallback, 0, 0))
    {
      FATAL_MIKTEX_ERROR ("Process::Run",
			  T_("The operation failed for some reason."),
			  fileName.Get());
    }
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:12,代码来源:Process.cpp

示例15:

void
PostScript::Uncompress (/*[in]*/ const char *	lpszFileName,
			/*[out]*/ PathName &	result)
{
  PathName source;
  if (! pDviImpl->FindGraphicsFile(lpszFileName, source))
  {
    FATAL_MIKTEX_ERROR ("PostScript::Uncompress",
      T_("Cannot find file."), lpszFileName);
  }
  Utils::UncompressFile (source.Get(), result);
  pDviImpl->RememberTempFile(lpszFileName, result);
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:13,代码来源:PostScript.cpp


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