當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。