📄 wmlcommand.h
字号:
// Magic Software, Inc.
// http://www.magic-software.com
// http://www.wild-magic.com
// Copyright (c) 2004. All Rights Reserved
//
// The Wild Magic Library (WML) source code is supplied under the terms of
// the license agreement http://www.magic-software.com/License/WildMagic.pdf
// and may not be copied or disclosed except in accordance with the terms of
// that agreement.
#ifndef WMLCOMMAND_H
#define WMLCOMMAND_H
#include "WmlSystem.h"
namespace Wml
{
class WML_ITEM Command
{
public:
Command (int iQuantity, char** apcArgument);
Command (char* acCmdline);
~Command ();
// return value is index of first excess argument
int ExcessArguments ();
// Set bounds for numerical arguments. If bounds are required, they must
// be set for each argument.
Command& Min (double dValue);
Command& Max (double dValue);
Command& Inf (double dValue);
Command& Sup (double dValue);
// The return value of the following methods is the option index within
// the argument array.
// Use the boolean methods for options which take no argument, for
// example in
// myprogram -debug -x 10 -y 20 filename
// the option -debug has no argument.
int Boolean (char* acName); // returns existence of option
int Boolean (char* acName, bool& rbValue);
int Integer (char* acName, int& riValue);
int Float (char* acName, float& rfValue);
int Double (char* acName, double& rdValue);
int String (char* acName, char*& racValue);
int Filename (char*& racName);
// last error reporting
const char* GetLastError ();
protected:
// constructor support
void Initialize ();
// command line information
int m_iQuantity; // number of arguments
char** m_apcArgument; // argument list (array of strings)
char* m_acCmdline; // argument list (single string)
bool* m_abUsed; // keeps track of arguments already processed
// parameters for bounds checking
double m_dSmall; // lower bound for numerical argument (min or inf)
double m_dLarge; // upper bound for numerical argument (max or sup)
bool m_bMinSet; // if true, compare: small <= arg
bool m_bMaxSet; // if true, compare: arg <= large
bool m_bInfSet; // if true, compare: small < arg
bool m_bSupSet; // if true, compare: arg < large
// last error strings
const char* m_acLastError;
static char ms_acOptionNotFound[];
static char ms_acArgumentRequired[];
static char ms_acArgumentOutOfRange[];
static char ms_acFilenameNotFound[];
};
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -