本文整理匯總了C++中AddOption函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddOption函數的具體用法?C++ AddOption怎麽用?C++ AddOption使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddOption函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: BOptionPopUp
PriorityControl::PriorityControl(const char *name, const char *label,
uint32 flags)
:
BOptionPopUp(name, label, new BMessage(kPriorityChanged), flags)
{
AddOption(MAKE_STRING(LOW), B_LOW_PRIORITY);
AddOption(MAKE_STRING(NORMAL), B_NORMAL_PRIORITY);
AddOption(MAKE_STRING(HIGH), B_NORMAL_PRIORITY + 2);
}
示例2: prep_dhcp_discover
// add DHCP DISCOVER fields to a basic BOOTP request
static int
prep_dhcp_discover(bootp_header_t *b)
{
unsigned char *p = b->bp_vend;
AddOption(p, dhcpCookie);
AddOption(p, dhcpDiscover);
AddOption(p, dhcpParamRequestList);
AddOption(p, dhcpEnd);
if (p < &b->bp_vend[BP_MIN_VEND_SIZE])
p = &b->bp_vend[BP_MIN_VEND_SIZE];
return p - (unsigned char *)b;
}
示例3: BuildSignature
void GetProjectInfoCommandType::BuildSignature(CommandSignature &signature)
{
auto infoTypeValidator = make_movable<OptionValidator>();
infoTypeValidator->AddOption(wxT("Name"));
infoTypeValidator->AddOption(wxT("NumberOfTracks"));
infoTypeValidator->AddOption(wxT("SelectedTracks"));
infoTypeValidator->AddOption(wxT("MuteTracks"));
infoTypeValidator->AddOption(wxT("SoloTracks"));
infoTypeValidator->AddOption(wxT("FocusedTrackID")); // returns the Track ID number of the track in focus
signature.AddParameter(wxT("Type"), wxT("Name"), std::move(infoTypeValidator));
}
示例4: BuildSignature
void ExportCommandType::BuildSignature(CommandSignature &signature)
{
auto modeValidator = make_movable<OptionValidator>();
modeValidator->AddOption(wxT("All"));
modeValidator->AddOption(wxT("Selection"));
signature.AddParameter(wxT("Mode"), wxT("All"), std::move(modeValidator));
auto filenameValidator = make_movable<DefaultValidator>();
signature.AddParameter(wxT("Filename"), wxT("exported.wav"), std::move(filenameValidator));
auto channelsValidator = make_movable<IntValidator>();
signature.AddParameter(wxT("Channels"), 1, std::move(channelsValidator));
}
示例5: prep_dhcp_request
// add DHCP REQUEST fields to a basic BOOTP request using data from supplied DHCP OFFER
static int
prep_dhcp_request(bootp_header_t *b, bootp_header_t *offer)
{
unsigned char *p = b->bp_vend;
AddOption(p, dhcpCookie);
AddOption(p, dhcpRequest);
AddOption(p, dhcpRequestIP);
memcpy(p, &offer->bp_yiaddr, dhcpRequestIP[1]);
p += dhcpRequestIP[1]; // Ask for the address just given
AddOption(p, dhcpParamRequestList);
AddOption(p, dhcpEnd);
if (p < &b->bp_vend[BP_MIN_VEND_SIZE])
p = &b->bp_vend[BP_MIN_VEND_SIZE];
return p - (unsigned char *)b;
}
示例6: AddOption
/**\brief Add multiple options
* If there were no options before, the first option is the new default.
* \param[in] options The list of new options.
*/
Dropdown* Dropdown::AddOptions( list<string> options ) {
list<string>::iterator iter;
for( iter = options.begin(); iter != options.end(); ++iter ) {
AddOption( *iter );
}
return this;
}
示例7: ReadOptionsFromCommandLine
void ReadOptionsFromCommandLine (int argc, char **argv)
{
int i, key, mod;
for (i = 1; i < argc; i++) {
mod = 1;
if (argv[i][0] != '-') {
if (i == 1)
continue;
else
mod = 0;
}
key = 0;
while (key < n_options && strcmp (&argv[i][mod], options[key]) != 0) {
key++;
}
if (key < n_options) {
i++;
if (i < argc)
mod = AddOption (key, argv[i]);
else
printf ("Didn't find value before end of command line option.\n");
if (mod == 0)
i--;
}
else {
printf ("Unrecognised option %s. Continuing.\n", argv[i]);
}
}
}
示例8: switch
void wxCmdLineParser::SetDesc(const wxCmdLineEntryDesc *desc)
{
for ( ;; desc++ )
{
switch ( desc->kind )
{
case wxCMD_LINE_SWITCH:
AddSwitch(desc->shortName, desc->longName, desc->description,
desc->flags);
break;
case wxCMD_LINE_OPTION:
AddOption(desc->shortName, desc->longName, desc->description,
desc->type, desc->flags);
break;
case wxCMD_LINE_PARAM:
AddParam(desc->description, desc->type, desc->flags);
break;
default:
wxFAIL_MSG( _T("unknown command line entry type") );
// still fall through
case wxCMD_LINE_NONE:
return;
}
}
}
示例9: AddOption
void CUrlOptions::AddOption(const std::string &key, const char *value)
{
if (key.empty() || value == NULL)
return;
return AddOption(key, std::string(value));
}
示例10: GetISystem
void CProfileOptions::Init()
{
XmlNodeRef root = GetISystem()->LoadXmlFromFile("libs/config/profiles/default/attributes.xml");
if(!root)
{
CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_WARNING, "Failed loading attributes.xml");
return;
}
CGameXmlParamReader reader(root);
const int childCount = reader.GetUnfilteredChildCount();
m_allOptions.reserve(childCount);
for (int i = 0; i < childCount; ++i)
{
XmlNodeRef node = reader.GetFilteredChildAt(i);
if(node)
{
AddOption(node);
}
}
IPlayerProfileManager* const profileManager = g_pGame->GetIGameFramework()->GetIPlayerProfileManager();
CRY_ASSERT_MESSAGE(profileManager != NULL, "IPlayerProfileManager doesn't exist - profile options will not be updated");
if(profileManager)
profileManager->AddListener(this, false);
}
示例11: AddOption
void CProfileOptions::SetOptionValue(const char* command, const char* param, bool toPendingOptions)
{
if (!command || !command[0])
return;
if (!param)
return;
if(!IsOption(command))
{
AddOption(command, param);
}
if (toPendingOptions)
{
AddOrReplacePendingOption(command, param);
return;
}
ScopedSwitchToGlobalHeap globalHeap;
std::vector<COption*>::const_iterator it = m_allOptions.begin();
std::vector<COption*>::const_iterator end = m_allOptions.end();
for(; it!=end; ++it)
{
if((*it)->GetName().compare(command)==0)
{
(*it)->Set(param);
}
}
}
示例12: SetClassPath
static void
SetClassPath(char *s)
{
char *def = MemAlloc(strlen(s) + 40);
sprintf(def, "-Djava.class.path=%s", s);
AddOption(def, NULL);
}
示例13: AddOption
EditorColourSet::EditorColourSet(const EditorColourSet& other) // copy ctor
{
m_Name = other.m_Name;
m_Sets.clear();
for (OptionSetsMap::const_iterator it = other.m_Sets.begin(); it != other.m_Sets.end(); ++it)
{
OptionSet& mset = m_Sets[it->first];
mset.m_Langs = it->second.m_Langs;
mset.m_Lexers = it->second.m_Lexers;
for (int i = 0; i <= wxSCI_KEYWORDSET_MAX; ++i)
{
mset.m_Keywords[i] = it->second.m_Keywords[i];
mset.m_originalKeywords[i] = it->second.m_originalKeywords[i];
}
mset.m_FileMasks = it->second.m_FileMasks;
mset.m_originalFileMasks = it->second.m_originalFileMasks;
mset.m_SampleCode = it->second.m_SampleCode;
mset.m_BreakLine = it->second.m_BreakLine;
mset.m_DebugLine = it->second.m_DebugLine;
mset.m_ErrorLine = it->second.m_ErrorLine;
mset.comment = it->second.comment;
mset.m_CaseSensitive = it->second.m_CaseSensitive;
const OptionColours& value = it->second.m_Colours;
for (unsigned int i = 0; i < value.GetCount(); ++i)
{
AddOption(it->first, value[i]);
}
}
}
示例14: _T
void CompilerOptions::AddOption(const wxString& name,
const wxString& option,
const wxString& category,
const wxString& additionalLibs,
bool doChecks,
const wxString& checkAgainst,
const wxString& checkMessage)
{
if (name.IsEmpty() || (option.IsEmpty() && additionalLibs.IsEmpty()))
return;
CompOption* coption = new CompOption;
wxString listboxname = name + _T(" [");
if (option.IsEmpty())
listboxname += additionalLibs;
else
listboxname += option;
listboxname += _T("]");
coption->name = listboxname;
coption->option = option;
coption->additionalLibs = additionalLibs;
coption->enabled = false;
coption->category = category;
coption->doChecks = doChecks;
coption->checkAgainst = checkAgainst;
coption->checkMessage = checkMessage;
AddOption(coption);
}
示例15: AddOption
void
CmdOptions::AddSoloOption (QString longName,
QString shortName,
QString msg)
{
Option * thisopt = AddOption (longName, shortName, msg);
thisopt->theType = Opt_Solo;
}