Exemplo n.º 1
0
bool
Utils::GetEnvironmentString (/*[in]*/ const char *		lpszName,
			     /*[out]*/ PathName &		path)
{
  return (Utils::GetEnvironmentString(lpszName,
				      path.GetBuffer(),
				      path.GetCapacity()));
}
Exemplo n.º 2
0
void
SessionImpl::RecordFileInfo (/*[in]*/ const char *	lpszPath,
                                      /*[in]*/ FileAccess	access)
{
    if (! (recordingFileNames
            || recordingPackageNames
            || packageHistoryFile.length() > 0))
    {
        return;
    }
    fileInfoRecords.reserve (50);
    FileInfoRecord fir;
    fir.fileName = lpszPath;
    fir.access = access;
    if (recordingPackageNames || packageHistoryFile.length() > 0)
    {
        PathName pathRelPath;
        if (IsTEXMFFile(lpszPath, pathRelPath.GetBuffer(), 0))
        {
            FileNameDatabase * pFndb = GetFileNameDatabase(GetMpmRoot());
            if (pFndb != 0)
            {
                AutoFndbRelease autoRelease (pFndb);
                PathNameArray paths;
                vector<string> packageNames;
                if (pFndb->Search(pathRelPath.Get(),
                                  MPM_ROOT_PATH,
                                  true,
                                  paths,
                                  packageNames))
                {
                    fir.packageName = packageNames[0];
                }
            }
        }
    }
    fileInfoRecords.push_back (fir);
    if (fileNameRecorderStream.IsOpen())
    {
        fileNameRecorderStream.WriteFormattedLine ("%s %s",
                (fir.access == FileAccess::Read
                 ? "INPUT"
                 : "OUTPUT"),
                PathName(fir.fileName).ToUnix().Get());
        fileNameRecorderStream.Flush ();
    }
}