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


C++ GetBool函数代码示例

本文整理汇总了C++中GetBool函数的典型用法代码示例。如果您正苦于以下问题:C++ GetBool函数的具体用法?C++ GetBool怎么用?C++ GetBool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetBool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: XRC_MAKE_INSTANCE

wxObject * MaxToggleButtonXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(control, MaxToggleButton)

    control->Create(m_parentAsWindow,
                    GetID(),
                    GetText(wxT("label")),
                    GetPosition(), GetSize(),
                    GetStyle(),
                    wxDefaultValidator,
                    GetName());

	control->MaxBind(CB_PREF(wx_wxtogglebutton_wxToggleButton__xrcNew)(control));

    control->SetValue(GetBool( wxT("checked")));
    SetupWindow(control);

    return control;
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:19,代码来源:glue.cpp

示例2: Get

    const bool ConfigManager::GetBool(const Urho3D::String& section, const Urho3D::String& parameter, const bool defaultValue)
    {
        auto value = Get(section, parameter);

        if (value.GetType() == Urho3D::VAR_BOOL)
            return value.GetBool();

        if (value.GetType() == Urho3D::VAR_STRING)
            return Urho3D::ToBool(value.GetString());

        // Parameter doesn't exist, or is a different type
        if (_saveDefaultParameters)
        {
            // Set back to default
            Set(section, parameter, defaultValue);
        }

        return defaultValue;
    }
开发者ID:carnalis,项目名称:urho_map,代码行数:19,代码来源:ConfigManager.cpp

示例3: FromXML

// build generator - needs uniqe name (checked by ModelBuilder)
// and optional count, which defaults to special "all rows value"
Generator * GeneratorTag :: FromXML( const ALib::XMLElement * e ) {

	RequireChildren( e );
	AllowAttrs( e, AttrList( NAME_ATTR, COUNT_ATTRIB, GROUP_ATTR,
								DEBUG_ATTRIB, HIDE_ATTR,
								OUT_ATTRIB, FNAMES_ATTR, 0 ) );
	string name = e->HasAttr( NAME_ATTR) ? e->AttrValue( NAME_ATTR ) : "";

	int count = GetCount( e );
	bool debug = GetBool( e, DEBUG_ATTRIB, NO_STR );
	FieldList grp( e->AttrValue( GROUP_ATTR, "" ));
	string ofn = GetOutputFile( e );
	string fields = e->AttrValue( FNAMES_ATTR, "" );
	std::auto_ptr <GeneratorTag> g(
		new GeneratorTag( name, count, debug, ofn, fields, grp )
	);
	g->AddSources( e );
	return g.release();
}
开发者ID:akki9c,项目名称:csvtest,代码行数:21,代码来源:dmk_generator.cpp

示例4: GetType

//---------------------------------------------------------------------------
bool IValue::operator!=(const IValue &a_Val) const
{
    char_type type1 = GetType(),
        type2 = a_Val.GetType();

    if (type1 == type2 || (IsScalar() && a_Val.IsScalar()))
    {
        switch (GetType())
        {
        case 's': return GetString() != a_Val.GetString();
        case 'i':
        case 'f': return GetFloat() != a_Val.GetFloat();
        case 'c': return (GetFloat() != a_Val.GetFloat()) || (GetImag() != a_Val.GetImag());
        case 'b': return GetBool() != a_Val.GetBool();
        case 'v': return true;
        case 'm': if (GetRows() != a_Val.GetRows() || GetCols() != a_Val.GetCols())
        {
            return true;
        }
                  else
                  {
                      for (int i = 0; i < GetRows(); ++i)
                      {
                          if (const_cast<IValue*>(this)->At(i) != const_cast<IValue&>(a_Val).At(i))
                              return true;
                      }

                      return false;
                  }
        default:
            ErrorContext err;
            err.Errc = ecINTERNAL_ERROR;
            err.Pos = -1;
            err.Type2 = GetType();
            err.Type1 = a_Val.GetType();
            throw ParserError(err);
        } // switch this type
    }
    else
    {
        return true;
    }
}
开发者ID:cloudqiu1110,项目名称:math-parser-benchmark-project,代码行数:44,代码来源:mpIValue.cpp

示例5: GetString

void ApplinkDialog::saveSettings()
{
	GetString(IDC_TMP_FOLDER, &gPreferences, IDC_TMP_FOLDER);
	GetString(IDC_EXCH_FOLDER, &gPreferences, IDC_EXCH_FOLDER);

	GetLong(IDC_COMBO_MAP_TYPE, &gPreferences, IDC_COMBO_MAP_TYPE);
	GetBool(IDC_CHK_EXP_MAT, &gPreferences, IDC_CHK_EXP_MAT);
	GetBool(IDC_CHK_EXP_UV, &gPreferences, IDC_CHK_EXP_UV);

	GetBool(IDC_CHK_IMP_MAT, &gPreferences, IDC_CHK_IMP_MAT);
	GetLong(IDC_COMBO_MAP_IMPORT, &gPreferences, IDC_COMBO_MAP_IMPORT);
	GetBool(IDC_CHK_IMP_UV, &gPreferences, IDC_CHK_IMP_UV);
	GetBool(IDC_CHK_REPLACE, &gPreferences, IDC_CHK_REPLACE);
	GetBool(IDC_CHK_PROMPT, &gPreferences, IDC_CHK_PROMPT);
	
	GetString(IDC_COAT_EXE_PATH, &gPreferences, IDC_COAT_EXE_PATH);
	GetBool(IDC_CHK_COAT_START, &gPreferences, IDC_CHK_COAT_START);
}
开发者ID:oyaGG,项目名称:3DCoat_Applinks,代码行数:18,代码来源:ApplinkDialog.cpp

示例6: GetBool

bool GetAllMenuCommands::Apply(CommandExecutionContext context)
{
   bool showStatus = GetBool(wxT("ShowStatus"));
   wxArrayString names;
   CommandManager *cmdManager = context.GetProject()->GetCommandManager();
   cmdManager->GetAllCommandNames(names, false);
   wxArrayString::iterator iter;
   for (iter = names.begin(); iter != names.end(); ++iter)
   {
      wxString name = *iter;
      wxString out = name;
      if (showStatus)
      {
         out += wxT("\t");
         out += cmdManager->GetEnabled(name) ? wxT("Enabled") : wxT("Disabled");
      }
      Status(out);
   }
   return true;
}
开发者ID:LBoggino,项目名称:audacity,代码行数:20,代码来源:GetAllMenuCommands.cpp

示例7: GetString

bool OpenProjectCommand::Apply(CommandExecutionContext context)
{
   wxString fileName = GetString(wxT("Filename"));
   bool addToHistory  = GetBool(wxT("AddToHistory"));
   wxString oldFileName = context.GetProject()->GetFileName();
   if(fileName == wxEmptyString)
   {
      context.GetProject()->OnOpen();
   }
   else
   {
      context.GetProject()->OpenFile(fileName, addToHistory);
   }
   const wxString &newFileName = context.GetProject()->GetFileName();

   // Because Open does not return a success or failure, we have to guess
   // at this point, based on whether the project file name has
   // changed and what to...
   return newFileName != wxEmptyString && newFileName != oldFileName;
}
开发者ID:Avi2011class,项目名称:audacity,代码行数:20,代码来源:OpenSaveCommands.cpp

示例8: switch

std::string Json::ToString( ){
	std::ostringstream ostr;
	switch(_kind){
		case kNull: { ostr << "Null" ; break; }
		case kNumber: { ostr << GetDouble() ; break; }
		case kString: { ostr << "\"" << GetString() << "\""; break; }
		case kTrue: case kFalse: { ostr << boolalpha << GetBool() ; break; }
		case kObject: 
		{
			ostr << "{";
	
			Object* obj = (Object*)_data;
			Object::const_iterator iter = obj->begin() ;
			size_t size = obj->size(), ind = 0;
			for(; iter != obj->end(); iter++){
				ostr << "\"" << iter->first << "\"" << ":" << iter->second->ToString();
				if(++ind < size) ostr << ",";
			}
		
			ostr << "}";
			break;
		}
		case kArray:
		{
			ostr << "[";
			Array& arr = *(Array*)_data;
			size_t size = arr.size(), ind = -1;

			for(; ++ind < size;){
				ostr << arr[ind]->ToString();
				if(ind+1 < size) ostr << ",";
			}

			ostr << "]";
			break;
		}
		default: break;

	}
	return ostr.str();
}
开发者ID:JackWyj,项目名称:Json-Parser,代码行数:41,代码来源:Json.cpp

示例9: Handle

//defineVoxel(integer, {left: })
//defineVoxel(type, textures)
void DefineVoxelHandler::Handle(CefRefPtr<CefProcessMessage> message){
    std::cout << "Define Voxel Handler" << std::endl;
    
    auto arguments = message->GetArgumentList();
    
    auto name = arguments->GetString(1);
    auto topImage = arguments->GetString(2);
    auto sideImage = arguments->GetString(3);
    auto bottomImage = arguments->GetString(4);
    auto transparent = arguments->GetBool(5);
    
    VoxelDefinition definition;
    definition.name = name;
    definition.topImage = topImage;
    definition.bottomImage = bottomImage;
    definition.sideImage = sideImage;
    definition.transparent = transparent;
    
    this->context->world->defineVoxel(definition);
    
}
开发者ID:nathanial,项目名称:salamancer,代码行数:23,代码来源:DefineVoxelHandler.cpp

示例10: LOGI

int Preferences::LoadFromRegistry(void)
{
    CString sval;
    bool bval;
    long lval;

    LOGI("Loading preferences from registry");

    fColumnLayout.LoadFromRegistry(kColumnSect);

    int i;
    for (i = 0; i < kPrefNumLastRegistry; i++) {
        if (fPrefMaps[i].registryKey == NULL)
            continue;

        switch (fPrefMaps[i].type) {
        case kBool:
            bval = GetPrefBool(fPrefMaps[i].num);
            SetPrefBool(fPrefMaps[i].num,
                GetBool(fPrefMaps[i].registrySection, fPrefMaps[i].registryKey, bval));
            break;
        case kLong:
            lval = GetPrefLong(fPrefMaps[i].num);
            SetPrefLong(fPrefMaps[i].num,
                GetInt(fPrefMaps[i].registrySection, fPrefMaps[i].registryKey, lval));
            break;
        case kString:
            sval = GetPrefString(fPrefMaps[i].num);
            SetPrefString(fPrefMaps[i].num,
                GetString(fPrefMaps[i].registrySection, fPrefMaps[i].registryKey, sval));
            break;
        default:
            LOGW("Invalid type %d on num=%d", fPrefMaps[i].type, i);
            ASSERT(false);
            break;
        }
    }

    return 0;
}
开发者ID:HankG,项目名称:ciderpress,代码行数:40,代码来源:Preferences.cpp

示例11: XRC_MAKE_INSTANCE

wxObject *kwxAngularMeterHandler::DoCreateResource()
{
    // the following macro will init a pointer named "control"
    // with a new instance of the MyControl class, but will NOT
    // Create() it!
    XRC_MAKE_INSTANCE(control, kwxAngularMeter)

    control->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize());
    control->SetNumTick(GetLong(wxT("num_ticks")));
    control->SetRange(GetLong(wxT("range_min"), 0), GetLong(wxT("range_max"), 220));
	control->SetAngle(GetLong(wxT("angle_min"), -20), GetLong(wxT("angle_max"), 200));
	int i = 1;
	while(1){
		wxString s = wxString::Format(wxT("sector_%d_colour"), i);
		if(!HasParam(s)){
			break;
		}
        // Setting the number of sectors each time around is not ideal but the alternative is to pre-process the XML.
        control->SetNumSectors(i);
		control->SetSectorColor(i - 1, GetColour(s, *wxWHITE));
		i++;
	}
   	control->DrawCurrent(GetBool(wxT("show_value"), true));
    control->SetNeedleColour(GetColour(wxT("needle_colour"), *wxRED));
    control->SetBackColour(GetColour(wxT("background_colour"), control->GetBackgroundColour()));
	control->SetBorderColour(GetColour(wxT("border_colour"), control->GetBackgroundColour()));
	// Avoid error if the font node isn't present.
	if(HasParam(wxT("font"))){
		wxFont font = GetFont();
		control->SetTxtFont(font);
	}
    control->SetValue(GetLong(wxT("value"), 0));

    SetupWindow(control);

    return control;
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:37,代码来源:xh_kwxangularmeterhandler.cpp

示例12: CreateFrame

wxObject *wxMdiXmlHandler::DoCreateResource()
{
    wxWindow *frame = CreateFrame();

    if (HasParam(wxT("size")))
        frame->SetClientSize(GetSize());
    if (HasParam(wxT("pos")))
        frame->Move(GetPosition());
    if (HasParam(wxT("icon")))
    {
        wxFrame* f = wxDynamicCast(frame, wxFrame);
        if (f)
            f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
    }

    SetupWindow(frame);

    CreateChildren(frame);

    if (GetBool(wxT("centered"), false))
        frame->Centre();

    return frame;
}
开发者ID:EdgarTx,项目名称:wx,代码行数:24,代码来源:xh_mdi.cpp

示例13: XRC_MAKE_INSTANCE

wxObject *wxRadioButtonXmlHandler::DoCreateResource()
{
    /* BOBM - implementation note.
     * once the wxBitmapRadioButton is implemented.
     * look for a bitmap property. If not null,
     * make it a wxBitmapRadioButton instead of the
     * normal radio button.
     */

    XRC_MAKE_INSTANCE(control, wxRadioButton)

    control->Create(m_parentAsWindow,
                    GetID(),
                    GetText(wxT("label")),
                    GetPosition(), GetSize(),
                    GetStyle(),
                    wxDefaultValidator,
                    GetName());

    control->SetValue(GetBool(wxT("value"), 0));
    SetupWindow(control);

    return control;
}
开发者ID:chromylei,项目名称:third_party,代码行数:24,代码来源:xh_radbt.cpp

示例14: GetBool

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Operand* Peephole::CreateRangeCompare(Operand* op, IntConstant* leftConst,
									  IntConstant* rightConst, const Type* resultType,
									  bool isUcmp, bool noLeftInc) {
	DebugValidator::IsTrue(IA::IsLargerOrEqual(rightConst, leftConst));

	// Create instructions that test if the operand is found in a range:
	// (op > leftConst) & (op < rightConst)
	// Add 1 to the left constant, creates some opportunities
    // by using >= instead of >.
	auto intKind = leftConst->GetType()->GetSubtype();
	__int64 leftPlusOne = noLeftInc ? leftConst->Value() : 
									  IA::Add(leftConst->Value(), 1, intKind);
	leftConst = irGen_.GetIntConst(leftConst->GetType(), leftPlusOne);

    if(IA::AreEqual(leftPlusOne, rightConst->Value(), intKind)) {
		// (op >= 5) & (op < 5) -> always false
		return GetBool(false, resultType);
	}

	// If 'leftConst' is the minimum value, we can eliminate the left part,
	// because 'op >= MIN" will always be true.
	__int64 min = IA::GetMin(leftConst->GetType(), isUcmp == false);

    if(IA::AreEqual(leftPlusOne, min, intKind)) {
		return CreateCompare(op, rightConst, Order_Less, resultType, isUcmp);
	}

	// Else emit a test of the form '(op - leftConst) < (rightConst - leftConst)'.
	// (op >= 4) & (op < 6) -> (op - 4) < 2
	__int64 diff = IA::Sub(rightConst, leftConst);
	auto diffOp = irGen_.GetIntConst(op->GetType(), diff);

	auto subOp = GetTemporary(op);
	irGen_.GetSub(op, leftConst, subOp);
	return CreateCompare(subOp, diffOp, Order_Less, resultType, true);
}
开发者ID:lgratian,项目名称:compiler,代码行数:37,代码来源:Peephole.cpp

示例15: XRC_MAKE_INSTANCE

wxObject *wxBitmapButtonXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(button, wxBitmapButton)

    button->Create(m_parentAsWindow,
                   GetID(),
                   GetBitmap(wxT("bitmap"), wxART_BUTTON),
                   GetPosition(), GetSize(),
                   GetStyle(wxT("style"), wxBU_AUTODRAW),
                   wxDefaultValidator,
                   GetName());
    if (GetBool(wxT("default"), 0))
        button->SetDefault();
    SetupWindow(button);

    if (!GetParamValue(wxT("selected")).IsEmpty())
        button->SetBitmapSelected(GetBitmap(wxT("selected")));
    if (!GetParamValue(wxT("focus")).IsEmpty())
        button->SetBitmapFocus(GetBitmap(wxT("focus")));
    if (!GetParamValue(wxT("disabled")).IsEmpty())
        button->SetBitmapDisabled(GetBitmap(wxT("disabled")));

    return button;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:24,代码来源:xh_bmpbt.cpp


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