本文整理汇总了C++中StringArray::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ StringArray::IsEmpty方法的具体用法?C++ StringArray::IsEmpty怎么用?C++ StringArray::IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringArray
的用法示例。
在下文中一共展示了StringArray::IsEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// Use the legacy main on Linux and assume UTF-8
int main(int argc, char** argv)
#endif
{
String cmdLine = Process::GetCommandLine();
ArgvParser ap(argc, argv);
if( !ap.HasFlag("file") )
{
// Display usage
String version = "PngOptimizerCL 2.4.1";
#if defined(_M_X64)
version = version + String(" (x64)");
#elif defined(_M_IX86)
version = version + String(" (x86)");
#endif
Console::WriteLine(version + " \xA9 2002/2014 Hadrien Nilsson - psydk.org");
Console::WriteLine("Converts GIF, BMP and TGA files to optimized PNG files.");
Console::WriteLine("Optimizes and cleans PNG files.");
Console::WriteLine("");
Console::WriteLine("Usage: PngOptimizerCL -file:\"yourfile.png\" [-recurs]");
POEngineSettings::WriteArgvUsage(" ");
Console::WriteLine("");
Console::WriteLine("Values enclosed with [] are optional.");
Console::WriteLine("Chunk option meaning: R=Remove, K=Keep, F=Force. 0|1|2 can be used too.");
Console::WriteLine("");
Console::WriteLine("Input examples:");
Console::WriteLine("Handle a specific file:");
Console::WriteLine(" PngOptimizerCL -file:\"icon.png\"");
Console::WriteLine("Handle specific file types in the current directory:");
Console::WriteLine(" PngOptimizerCL -file:\"*.png|*.bmp\"");
Console::WriteLine("Handle any supported file in the current directory:");
Console::WriteLine(" PngOptimizerCL -file:\"*\"");
Console::WriteLine("Handle specific file types in the current directory (recursive):");
Console::WriteLine(" PngOptimizerCL -file:\".png|*.bmp\" -recurs");
Console::WriteLine("Handle a specific directory (recursive):");
Console::WriteLine(" PngOptimizerCL -file:\"gfx/\"");
Console::WriteLine("");
if( Console::IsOwned() )
{
Console::Write("Press any key to continue");
Console::WaitForKey();
}
return 0;
}
POApplicationConsole app;
// PngOptimizer.exe -file:"myfile.png"
POEngine engine;
if( !engine.WarmUp() )
{
Console::WriteLine("Warm-up failed");
return 1;
}
engine.Progressing.Handle(&app, &POApplicationConsole::OnEngineProgressing);
engine.m_settings.LoadFromArgv(ap);
//////////////////////////////////////////////////////////////////
String filePath = ap.GetFlagString("file");
String dir, fileName;
FilePath::Split(filePath, dir, fileName);
StringArray filePaths;
String joker;
if( ap.HasFlag("recurs") )
{
filePaths.Add(dir);
joker = fileName;
}
else
{
filePaths = Directory::GetFileNames(dir, fileName, true);
if( filePaths.IsEmpty() )
{
// For PngOptimizerCL, it is an error if we have nothing to optimize
Color32 col = POEngine::ColorFromTextType(POEngine::TT_ErrorMsg);
Console::SetTextColor(col);
Console::WriteLine("File not found: " + filePath);
Console::ResetTextColor();
return 1;
}
}
if( !engine.OptimizeFiles(filePaths, joker) )
{
return 1;
}
return 0;
}