本文整理汇总了C++中FileType::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ FileType::Get方法的具体用法?C++ FileType::Get怎么用?C++ FileType::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileType
的用法示例。
在下文中一共展示了FileType::Get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetConfigValue
void
SessionImpl::RegisterFileType (/*[in]*/ FileType fileType,
/*[in]*/ const char * lpszFileType,
/*[in]*/ const char * lpszApplication,
/*[in]*/ const char * lpszFileNameExtensions,
/*[in]*/ const char * lpszAlternateExtensions,
/*[in]*/ const char * lpszDefaultSearchPath,
/*[in]*/ const char * lpszEnvVarNames)
{
MIKTEX_ASSERT_STRING (lpszFileType);
MIKTEX_ASSERT_STRING_OR_NIL (lpszApplication);
InternalFileTypeInfo fti;
fti.fileType = fileType;
fti.fileTypeString = lpszFileType;
if (lpszApplication != 0)
{
fti.applicationName = lpszApplication;
}
string section = "ft.";
section += lpszFileType;
fti.fileNameExtensions =
GetConfigValue(section.c_str(),
"extensions",
lpszFileNameExtensions );
fti.alternateExtensions = GetConfigValue(section.c_str(),
"alternate_extensions",
lpszAlternateExtensions == 0 ? "" : lpszAlternateExtensions);
fti.searchPath =
GetConfigValue(section.c_str(),
"path",
lpszDefaultSearchPath);
fti.envVarNames =
GetConfigValue(section.c_str(),
"env",
lpszEnvVarNames);
fileTypes.resize (FileType::E_N_D);
fileTypes[fileType.Get()] = fti;
}
示例2: if
void
SessionImpl::RegisterFileType (/*[in]*/ FileType fileType)
{
if (fileType.Get() >= fileTypes.size())
{
fileTypes.resize (FileType::E_N_D);
}
if (fileTypes[fileType.Get()].fileType == fileType.Get())
{
// already registered
return;
}
switch (fileType.Get())
{
case FileType::AFM:
RegisterFileType (
FileType::AFM,
"afm",
0,
".afm",
P2_(CURRENT_DIRECTORY, R_(MIKTEX_PATH_AFM_DIR)),
P2_("AFMFONTS", "TEXFONTS"));
break;
case FileType::BASE:
RegisterFileType (
FileType::BASE,
"base",
"METAFONT",
".base",
P2_(CURRENT_DIRECTORY, s_(MIKTEX_PATH_BASE_DIR)),
"");
break;
case FileType::BIB:
RegisterFileType (
FileType::BIB,
"bib",
"BibTeX",
".bib",
P2_(CURRENT_DIRECTORY, R_(MIKTEX_PATH_BIBTEX_DIR "/bib")),
P2_("BIBINPUTS", "TEXBIB"));
break;
case FileType::BST:
RegisterFileType (
FileType::BST,
"bst",
"BibTeX",
".bst",
P2_(CURRENT_DIRECTORY, R_(MIKTEX_PATH_BIBTEX_DIR "/{bst,csf}")),
"BSTINPUTS");
break;
case FileType::CID:
RegisterFileType (
FileType::CID,
"cid maps",
0,
P2_(".cid", ".cidmap"),
P2_(CURRENT_DIRECTORY, R_(MIKTEX_PATH_CIDMAP_DIR)),
"FONTCIDMAPS");
break;
case FileType::CLUA:
RegisterFileType (
FileType::CLUA,
"clua",
0,
P2_(".dll", ".so"),
P2_(CURRENT_DIRECTORY, R_(MIKTEX_PATH_SCRIPT_DIR "/{$progname,$engine,}/lua")),
"CLUAINPUTS");
break;
case FileType::CNF:
RegisterFileType (
FileType::CNF,
"cnf",
0,
".cnf",
S_(MIKTEX_PATH_WEB2C_DIR),
"TEXMFCNF");
break;
case FileType::CMAP:
RegisterFileType (
FileType::CMAP,
"cmap files",
0,
"",
P2_(CURRENT_DIRECTORY, R_(MIKTEX_PATH_CMAP_DIR)),
P2_("CMAPFONTS", "TEXFONTS"));
break;
case FileType::CWEB:
RegisterFileType (
//.........这里部分代码省略.........
示例3: xxx
bool
SessionImpl::TryCreateFile (/*[in]*/ const char * lpszFileName,
/*[in]*/ FileType fileType)
{
CommandLineBuilder commandLine;
PathName makeUtility;
char szBasename[BufferSizes::MaxPath];
PathName::Split (lpszFileName, 0, 0, szBasename, BufferSizes::MaxPath, 0, 0);
switch (fileType.Get())
{
case FileType::BASE:
case FileType::FMT:
if (! FindFile(MIKTEX_INITEXMF_EXE, FileType::EXE, makeUtility))
{
FATAL_MIKTEX_ERROR ("SessionImpl::TryCreateFile",
T_("The MiKTeX configuration utility could not be found."),
0);
}
commandLine.AppendOption ("--dump-by-name=", szBasename);
if (fileType == FileType::FMT)
{
commandLine.AppendOption ("--engine=", GetEngine());
}
break;
case FileType::TFM:
if (! FindFile(MIKTEX_MAKETFM_EXE, FileType::EXE, makeUtility))
{
FATAL_MIKTEX_ERROR ("SessionImpl::TryCreateFile",
T_("The MakeTFM utility could not be found."),
0);
}
commandLine.AppendOption ("-v");
commandLine.AppendArgument (szBasename);
break;
default:
return (false);
}
const size_t BUF_SIZE = 50000;
char * szBuf = reinterpret_cast<char*>(malloc(BUF_SIZE));
if (szBuf == 0)
{
OUT_OF_MEMORY ("malloc");
}
AutoMemoryPointer xxx (szBuf);
size_t size = BUF_SIZE;
int exitCode;
if (! Process::Run(makeUtility,
commandLine.Get(),
szBuf,
&size,
&exitCode))
{
return (false);
}
if (exitCode != 0)
{
TraceError (T_("Make failed; output follows"));
TraceError ("%.*s", static_cast<int>(size), szBuf);
return (false);
}
return (true);
}