本文整理汇总了C++中ArgumentList::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentList::IsEmpty方法的具体用法?C++ ArgumentList::IsEmpty怎么用?C++ ArgumentList::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgumentList
的用法示例。
在下文中一共展示了ArgumentList::IsEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessCommandLine
int PreferencesProcess::ProcessCommandLine( const StringList& argv ) const
{
ArgumentList arguments = ExtractArguments( argv, ArgumentItemMode::NoItems );
PreferencesInstance instance( this );
bool launchInterface = false;
for ( ArgumentList::const_iterator i = arguments.Begin(); i != arguments.End(); ++i )
{
const Argument& arg = *i;
if ( arg.IsNumeric() )
{
throw Error( "Unknown numeric argument: " + arg.Token() );
}
else if ( arg.IsString() )
{
throw Error( "Unknown string argument: " + arg.Token() );
}
else if ( arg.IsSwitch() )
{
throw Error( "Unknown switch argument: " + arg.Token() );
}
else if ( arg.IsLiteral() )
{
if ( arg.Id() == "-interface" )
launchInterface = true;
else if ( arg.Id() == "-help" )
{
ShowHelp();
return 0;
}
else
throw Error( "Unknown argument: " + arg.Token() );
}
else if ( arg.IsItemList() )
throw Error( "Invalid non-parametric argument: " + arg.Token() );
}
if ( launchInterface || arguments.IsEmpty() )
instance.LaunchInterface();
else
instance.LaunchGlobal();
return 0;
}
示例2: ProcessCommandLine
int ColorManagementSetupProcess::ProcessCommandLine( const StringList& argv ) const
{
ArgumentList arguments = ExtractArguments( argv, ArgumentItemMode::NoItems );
ColorManagementSetupInstance instance( this );
bool launchInterface = false;
for ( ArgumentList::const_iterator i = arguments.Begin(); i != arguments.End(); ++i )
{
const Argument& arg = *i;
if ( arg.IsNumeric() )
{
throw Error( "Unknown numeric argument: " + arg.Token() );
}
else if ( arg.IsString() )
{
if ( arg.Id() == "rgb-profile" )
{
instance.defaultRGBProfile = arg.StringValue();
instance.defaultRGBProfile.Trim();
if ( instance.defaultRGBProfile.IsEmpty() )
throw Error( "Empty RGB profile: " + arg.Token() );
}
else if ( arg.Id() == "grayscale-profile" )
{
instance.defaultGrayProfile = arg.StringValue();
instance.defaultGrayProfile.Trim();
if ( instance.defaultGrayProfile.IsEmpty() )
throw Error( "Empty grayscale profile: " + arg.Token() );
}
else if ( arg.Id() == "proofing-profile" )
{
instance.proofingProfile = arg.StringValue();
instance.proofingProfile.Trim();
if ( instance.proofingProfile.IsEmpty() )
throw Error( "Empty proofing profile: " + arg.Token() );
}
else if ( arg.Id() == "rendering-intent" || arg.Id() == "proofing-intent" )
{
pcl_enum intent;
if ( arg.StringValue() == "perceptual" )
intent = CMSDefaultRenderingIntent::Perceptual;
else if ( arg.StringValue() == "saturation" )
intent = CMSDefaultRenderingIntent::Saturation;
else if ( arg.StringValue() == "relative" || arg.StringValue() == "relativeColorimetric" )
intent = CMSDefaultRenderingIntent::RelativeColorimetric;
else if ( arg.StringValue() == "absolute" || arg.StringValue() == "absoluteColorimetric" )
intent = CMSDefaultRenderingIntent::AbsoluteColorimetric;
else
throw Error( "Invalid rendering intent: " + arg.Token() );
if ( arg.Id() == "rendering-intent" )
instance.defaultRenderingIntent = intent;
else
instance.proofingIntent = intent;
}
else if ( arg.Id() == "on-profile-mismatch" )
{
if ( arg.StringValue() == "ask" )
instance.onProfileMismatch = CMSOnProfileMismatch::AskUser;
else if ( arg.StringValue() == "keep" )
instance.onProfileMismatch = CMSOnProfileMismatch::KeepEmbedded;
else if ( arg.StringValue() == "convert" )
instance.onProfileMismatch = CMSOnProfileMismatch::ConvertToDefault;
else if ( arg.StringValue() == "discard" )
instance.onProfileMismatch = CMSOnProfileMismatch::DiscardEmbedded;
else if ( arg.StringValue() == "disable" )
instance.onProfileMismatch = CMSOnProfileMismatch::DisableCM;
else
throw Error( "Invalid profile mismatch policy: " + arg.Token() );
}
else if ( arg.Id() == "on-missing-profile" )
{
if ( arg.StringValue() == "ask" )
instance.onMissingProfile = CMSOnMissingProfile::AskUser;
else if ( arg.StringValue() == "default" )
instance.onMissingProfile = CMSOnMissingProfile::AssignDefault;
else if ( arg.StringValue() == "ignore" )
instance.onMissingProfile = CMSOnMissingProfile::LeaveUntagged;
else if ( arg.StringValue() == "disable" )
instance.onMissingProfile = CMSOnMissingProfile::DisableCM;
else
throw Error( "Invalid missing profile policy: " + arg.Token() );
}
else if ( arg.Id() == "gamut-warning-color" )
{
instance.gamutWarningColor = RGBAColor( arg.StringValue() );
}
else
throw Error( "Unknown string argument: " + arg.Token() );
}
else if ( arg.IsSwitch() )
{
if ( arg.Id() == "embed-rgb" )
instance.defaultEmbedProfilesInRGBImages = arg.SwitchState();
else if ( arg.Id() == "embed-grayscale" )
instance.defaultEmbedProfilesInGrayscaleImages = arg.SwitchState();
else if ( arg.Id() == "proofing-bpc" )
instance.useProofingBPC = arg.SwitchState();
//.........这里部分代码省略.........
示例3: ProcessCommandLine
//.........这里部分代码省略.........
else if ( arg.Id() == "preview-center" )
options.EnablePreviewCenter( arg.SwitchState() );
else if ( arg.Id() == "broadcast" )
options.EnableBroadcast( arg.SwitchState() );
else
throw Error( "Unknown switch argument: " + arg.Token() );
}
else if ( arg.IsLiteral() )
{
if ( arg.Id() == "m" || arg.Id() == "mean" )
options.SetMode( ReadoutMode::Mean );
else if ( arg.Id() == "n" || arg.Id() == "median" )
options.SetMode( ReadoutMode::Median );
else if ( arg.Id() == "M" || arg.Id() == "max" || arg.Id() == "maximum" )
options.SetMode( ReadoutMode::Maximum );
else if ( arg.Id() == "N" || arg.Id() == "min" || arg.Id() == "minimum" )
options.SetMode( ReadoutMode::Minimum );
else if ( arg.Id() == "rgb" || arg.Id() == "RGB" )
options.SetData( ReadoutData::RGBK );
else if ( arg.Id() == "rgbl" || arg.Id() == "RGBL" )
options.SetData( ReadoutData::RGBL );
else if ( arg.Id() == "rgby" || arg.Id() == "RGBY" )
options.SetData( ReadoutData::RGBY );
else if ( arg.Id() == "xyz" || arg.Id() == "XYZ" )
options.SetData( ReadoutData::CIEXYZ );
else if ( arg.Id() == "lab" || arg.Id() == "Lab" )
options.SetData( ReadoutData::CIELab );
else if ( arg.Id() == "lch" || arg.Id() == "Lch" )
options.SetData( ReadoutData::CIELch );
else if ( arg.Id() == "hsv" || arg.Id() == "HSV" )
options.SetData( ReadoutData::HSV );
else if ( arg.Id() == "hsi" || arg.Id() == "HSI" || arg.Id() == "HSL" )
options.SetData( ReadoutData::HSI );
else if ( arg.Id() == "i8" )
{
options.SetInteger();
options.SetIntegerRange( 255 );
}
else if ( arg.Id() == "i10" )
{
options.SetInteger();
options.SetIntegerRange( 1023 );
}
else if ( arg.Id() == "i12" )
{
options.SetInteger();
options.SetIntegerRange( 4095 );
}
else if ( arg.Id() == "i14" )
{
options.SetInteger();
options.SetIntegerRange( 16383 );
}
else if ( arg.Id() == "i16" )
{
options.SetInteger();
options.SetIntegerRange( 65535 );
}
else if ( arg.Id() == "i32" )
{
options.SetInteger();
options.SetIntegerRange( 4294967295ul );
}
else if ( arg.Id() == "alpha" )
options.EnableAlphaChannel();
else if ( arg.Id() == "mask" )
options.EnableMaskChannel();
else if ( arg.Id() == "preview" )
options.EnablePreview();
else if ( arg.Id() == "preview-center" )
options.EnablePreviewCenter();
else if ( arg.Id() == "broadcast" )
options.EnableBroadcast();
else if ( arg.Id() == "-load" )
options = ReadoutOptions::GetCurrentOptions();
else if ( arg.Id() == "-interface" )
launchInterface = true;
else if ( arg.Id() == "-help" )
{
ShowHelp();
return 0;
}
else
throw Error( "Unknown argument: " + arg.Token() );
}
else if ( arg.IsItemList() )
throw Error( "Invalid non-parametric argument: " + arg.Token() );
}
ReadoutOptionsInstance instance( this );
instance.SetOptions( options );
if ( launchInterface || arguments.IsEmpty() )
instance.LaunchInterface();
else
instance.LaunchGlobal();
return 0;
}