当前位置: 首页>>代码示例>>C++>>正文


C++ AddOption函数代码示例

本文整理汇总了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);
}
开发者ID:diversys,项目名称:bescreencapture,代码行数:9,代码来源:PriorityControl.cpp

示例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;
}
开发者ID:Palantir555,项目名称:ecos-mars-zx3,代码行数:13,代码来源:bootp.c

示例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));
}
开发者ID:henricj,项目名称:audacity,代码行数:12,代码来源:GetProjectInfoCommand.cpp

示例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));
}
开发者ID:RaphaelMarinier,项目名称:audacity,代码行数:13,代码来源:ImportExportCommands.cpp

示例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;
}
开发者ID:Palantir555,项目名称:ecos-mars-zx3,代码行数:16,代码来源:bootp.c

示例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;
}
开发者ID:DuMuT6p,项目名称:Epiar,代码行数:11,代码来源:ui_dropdown.cpp

示例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]);
    }
  }
}
开发者ID:timmassingham,项目名称:SLR,代码行数:30,代码来源:options.c

示例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;
        }
    }
}
开发者ID:EdgarTx,项目名称:wx,代码行数:29,代码来源:cmdline.cpp

示例9: AddOption

void CUrlOptions::AddOption(const std::string &key, const char *value)
{
  if (key.empty() || value == NULL)
    return;

  return AddOption(key, std::string(value));
}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:7,代码来源:UrlOptions.cpp

示例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);
}
开发者ID:aronarts,项目名称:FireNET,代码行数:28,代码来源:ProfileOptions.cpp

示例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);
    }
  }
}
开发者ID:aronarts,项目名称:FireNET,代码行数:31,代码来源:ProfileOptions.cpp

示例12: SetClassPath

static void
SetClassPath(char *s)
{
    char *def = MemAlloc(strlen(s) + 40);
    sprintf(def, "-Djava.class.path=%s", s);
    AddOption(def, NULL);
}
开发者ID:zxlooong,项目名称:jdk14219,代码行数:7,代码来源:java.c

示例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]);
        }
    }
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:31,代码来源:editorcolourset.cpp

示例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);
}
开发者ID:stahta01,项目名称:codeAdapt_IDE,代码行数:29,代码来源:compileroptions.cpp

示例15: AddOption

void
CmdOptions::AddSoloOption (QString longName,
                          QString shortName,
                          QString msg)
{
  Option * thisopt = AddOption (longName, shortName, msg);
  thisopt->theType = Opt_Solo;
}
开发者ID:berndhs,项目名称:carpo,代码行数:8,代码来源:cmdoptions.cpp


注:本文中的AddOption函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。