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


C++ SetDefault函数代码示例

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


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

示例1: main

extern int main(int argc, char **argv) {

  FILE_LIST *fl;
  char *command;

  SetDefault();
  fl = GetOption(option, argc, argv, NULL);

  InitMessage("wfccontrol", NULL);

  if ((fl != NULL) && (fl->name != NULL)) {
    command = fl->name;
  } else {
    command = "stop";
  }

  InitSystem();
  MainProc(command);
  CleanUp();
  return (0);
}
开发者ID:montsuqi,项目名称:panda,代码行数:21,代码来源:wfcctrl.c

示例2: Bind

MapElementFactory::MapElementFactory()
{
    Bind( AutoId( "default" ), &CreateMapElement<DefaultMapElement> );
    SetDefault( AutoId( "default" ) );

    Bind( AutoId( "link" ), &CreateMapElement<LinkMapElement> );
    Bind( AutoId( "map_start" ), &CreateMapElement<MapStartMapElement> );
    Bind( AutoId( "spawn_soldiers" ), &CreateMapElement<SpawnSoldiersMapElement> );
    Bind( AutoId( "soldier_spawn_point" ), &CreateMapElement<SoldierSpawnPointMapElement> );
    Bind( AutoId( "spawn_actor" ), &CreateMapElement<SpawnActorMapElement> );
    Bind( AutoId( "respawn_actor" ), &CreateMapElement<RespawnActorMapElement> );
    Bind( AutoId( "ctf_soldier_spawn_point" ), &CreateMapElement<ctf::CtfSoldierSpawnPointMapElement> );
    Bind( AutoId( "ctf_spawn_soldiers" ), &CreateMapElement<ctf::CtfSpawnSoldiersMapElement> );
    Bind( AutoId( "ctf_flag_spawn_point" ), &CreateMapElement<ctf::CtfFlagSpawnPointMapElement> );
    Bind( AutoId( "ctf_spawn_flags" ), &CreateMapElement<ctf::CtfSpawnFlagsMapElement> );
    Bind( AutoId( "soldier_auto_revive" ), &CreateMapElement<SoldierAutoReviveMapElement> );
    Bind( AutoId( "level_generator" ), &CreateMapElement<LevelGeneratorMapElement> );
    Bind( AutoId( "level_generated" ), &CreateMapElement<LevelGeneratedMapElement> );
    Bind( AutoId( "group" ), &CreateMapElement<GroupMapElement> );
    Bind( AutoId( "recreate_borders" ), &CreateMapElement<RecreateBordersMapElement> );
}
开发者ID:HalalUr,项目名称:Reaping2,代码行数:21,代码来源:map_element_factory.cpp

示例3: SetDefault

void
FeatureState::SetDefaultFromPref(const char* aPrefName,
                                 bool aIsEnablePref,
                                 bool aDefaultValue)
{
  bool baseValue = Preferences::GetDefaultBool(aPrefName, aDefaultValue);
  SetDefault(baseValue == aIsEnablePref, FeatureStatus::Disabled, "Disabled by default");

  if (Preferences::HasUserValue(aPrefName)) {
    bool userValue = Preferences::GetBool(aPrefName, aDefaultValue);
    if (userValue == aIsEnablePref) {
      nsCString message("Enabled via ");
      message.AppendASCII(aPrefName);
      UserEnable(message.get());
    } else {
      nsCString message("Disabled via ");
      message.AppendASCII(aPrefName);
      UserDisable(message.get(), NS_LITERAL_CSTRING("FEATURE_FAILURE_PREF_OFF"));
    }
  }
}
开发者ID:brendandahl,项目名称:positron,代码行数:21,代码来源:gfxFeature.cpp

示例4: ZeroMemory

int AUDIOSOURCELIST::Append(AUDIOSOURCE* pNext)
{
	info.audiosources = (AUDIOSOURCE**)realloc(info.audiosources,(info.iCount+1)*sizeof(AUDIOSOURCE*));
	info.audiosources[info.iCount] = pNext;

	if (info.iCount) {
		pNext->SetBias(info.audiosources[info.iCount-1]->GetBias()+info.audiosources[info.iCount-1]->GetDuration());
	} else {
		pNext->SetBias(0);
		char cBuffer[2048];
		ZeroMemory(cBuffer,sizeof(cBuffer));
	//	pNext->GetName(cBuffer);
	//	SetName(cBuffer);
		GetTitleSet()->Import(pNext->GetTitleSet());

		ZeroMemory(cBuffer,sizeof(cBuffer));
		
		std::string languageCode;
		pNext->GetLanguageCode(languageCode);
		SetLanguageCode(languageCode);
		SetTimecodeScale(1000);
		SetDefault(pNext->IsDefault());
	}

	info.iCount++;
	if (info.iCount == 1) {
		info.active_source = info.audiosources[0];
	}

	for (int i=0;i<info.iCount;i++) {
		if (!info.audiosources[i]->IsAVIOutputPossible()) {
			AllowAVIOutput(false);
		}
	}

	pNext->SetDelayMMS(this);
	pNext->ReInit();

	return AS_OK;
}
开发者ID:BrunoReX,项目名称:avimuxgui,代码行数:40,代码来源:AudioSource_List.cpp

示例5: main

int main (int argc_, char* argv_[])
#endif
{
#ifdef __APPLE__
    // OS X lacks a unique Right-Ctrl key, so enable the "Left-Alt for Cntrl" option by default
    SetDefault(altforcntrl,true);
#endif

    if (Main::Init(argc_, argv_))
#ifdef RETRO
       ;
#else 
       CPU::Run();
#endif

#ifdef RETRO
return 0;
#endif
    Main::Exit();

    return 0;
}
开发者ID:libretro,项目名称:libretro-simcoupe,代码行数:22,代码来源:OSD.cpp

示例6: throw

void XJCMD_QUERY_PROGRESSSC::Decode(const unsigned char *buffer,unsigned int& buffersize) throw (DecodeError)
{
    const unsigned char *p;
    p = buffer;
    SetDefault();

        if (1 > buffersize)
        throw DecodeError();
    firsttime = *p;
    --buffersize;
    ++p;
    if (1 > buffersize)
        throw DecodeError();
    levels_can_jump = *p;
    --buffersize;
    ++p;
    if (1 > buffersize)
        throw DecodeError();
    play_times = *p;
    --buffersize;
    ++p;
    if (1 > buffersize)
        throw DecodeError();
    max_play_times = *p;
    --buffersize;
    ++p;
    if (1 > buffersize)
        throw DecodeError();
    have_progress = *p;
    --buffersize;
    ++p;

	if (have_progress == 1) {  
    arraysize = buffersize;
    progress.Decode(p, arraysize);
    p += (buffersize-arraysize);
    buffersize = arraysize;
	}
}
开发者ID:llisper,项目名称:lite_client,代码行数:39,代码来源:ProtoSyt.cpp

示例7: ZeroMemory

SUBTITLESFROMMATROSKA::SUBTITLESFROMMATROSKA(MATROSKA* m, int iStream)
{
	info.m = m;
	info.iStream = iStream;

	if (info.m->GetTrackType(info.iStream)!=MSTRT_SUBT) {
		ZeroMemory(&info,sizeof(info));
	} else {
		info.m->SetActiveTrack(info.iStream);
		cCodecPrivate = (char*)info.m->GetCodecPrivate(info.iStream);
		iCP_length = info.m->GetCodecPrivateSize(info.iStream);

		if (!strcmp(info.m->GetCodecID(),"S_TEXT/UTF8")) {
			info.iFormat = SUBFORMAT_SRT;
		} else 
		if (!strcmp(info.m->GetCodecID(),"S_SSA")) {
			info.iFormat = SUBFORMAT_SSA;
		} else 
		if (!strcmp(info.m->GetCodecID(),"S_TEXT/SSA")) {
			info.iFormat = SUBFORMAT_SSA;
		} else
		if (!strcmp(info.m->GetCodecID(),"S_TEXT/ASS")) {
			info.iFormat = SUBFORMAT_SSA;
		} else
		if (!strcmp(info.m->GetCodecID(),"S_VOBSUB")) {
			info.iFormat = SUBFORMAT_VOBSUB;
		} 

		if (GetFormat() == SUBFORMAT_SSA) {
			ReadSSAHeader();
			ReadSSAStyles();
		}
		SetTimecodeScale(info.m->GetTimecodeScale());
		SetDefault(info.m->IsDefault(info.iStream));

		GetTitleSet()->Import(info.m->GetTrackTitleSet());
	}
}
开发者ID:BrunoReX,项目名称:avimuxgui,代码行数:38,代码来源:SubTitles.cpp

示例8: ZeroMemory

BOOL CAutoReg::CreateEntry(	LPREGENTRY pReg, HKEY hKey, LPCTSTR pKey, DWORD dwType,
						LPCTSTR pName, void* pvoidData, DWORD dwLength,
						DWORD dwDef, void* pvoidDef, DWORD dwDefLength,
						DWORD dwUser, LPCTSTR pComputer )
{_STTEX();
	// Sanity Checks
	if ( pReg == NULL ) return FALSE;
	if ( pKey == NULL ) return FALSE;

	// Blank out the structure
	ZeroMemory( (LPVOID)pReg, sizeof( REGENTRY ) );

	// Save the users data
	
	// Key info
	pReg->hKey		= hKey;
	strcpy( pReg->szKey, pKey );
	pReg->dwType	= dwType;

	// User variable info
	pReg->dwLength	= dwLength;
	if ( pName == NULL || pName[ 0 ] == 0x0 ) pReg->szName[ 0 ] = 0x0;
	else strcpy( pReg->szName, pName );
	pReg->pvoidData	= pvoidData;
	
	// Set user default value info
	SetDefault(	pReg, dwDef, pvoidDef, dwDefLength );

	// User value
	pReg->dwUser = dwUser;

	// Remote computer info
	if ( pComputer != NULL && pComputer[ 0 ] != 0x0 )
		strcpy( pReg->szComputer, pComputer );
	else pReg->szComputer[ 0 ] = 0x0;

	return TRUE;
} 
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:38,代码来源:AutoReg.cpp

示例9: SetDefault

//-----------------------------------------------------------------------------
// Purpose: Private creation
//-----------------------------------------------------------------------------
void ConVar::Create( const char *pName, const char *pDefaultValue, int flags /*= 0*/,
	const char *pHelpString /*= NULL*/, bool bMin /*= false*/, float fMin /*= 0.0*/,
	bool bMax /*= false*/, float fMax /*= false*/, FnChangeCallback_t callback /*= NULL*/ )
{
	m_pParent = this;

	// Name should be static data
	SetDefault( pDefaultValue );

	m_StringLength = strlen( m_pszDefaultValue ) + 1;
	m_pszString = new char[m_StringLength];
	memcpy( m_pszString, m_pszDefaultValue, m_StringLength );
	
	m_bHasMin = bMin;
	m_fMinVal = fMin;
	m_bHasMax = bMax;
	m_fMaxVal = fMax;
	
	m_fnChangeCallback = callback;

	m_fValue = ( float )atof( m_pszString );

	// Bounds Check, should never happen, if it does, no big deal
	if ( m_bHasMin && ( m_fValue < m_fMinVal ) )
	{
		Assert( 0 );
	}

	if ( m_bHasMax && ( m_fValue > m_fMaxVal ) )
	{
		Assert( 0 );
	}

	m_nValue = ( int )m_fValue;

	BaseClass::Create( pName, pHelpString, flags );
}
开发者ID:AnnoyedTree,项目名称:source-sdk-2013,代码行数:40,代码来源:convar.cpp

示例10: main

extern int main(int argc, char **argv) {
  struct stat sb;
  DBG_Struct *dbg;
  int i;
  SetDefault();
  GetOption(option, argc, argv, NULL);
  InitSystem();

  if ((Socket == NULL) || (ExportID == NULL)) {
    PrintUsage(option, argv[0], NULL);
    exit(1);
  }

  for (i = 0;; i++) {
    if (stat(Socket, &sb) != -1) {
      break;
    }
    if (i >= RETRY) {
      Error("%s %s", strerror(errno), Socket);
    }
    sleep(1);
  }
  if (!S_ISSOCK(sb.st_mode)) {
    Error("%s is not socket file", Socket);
  }

  dbg = GetDBG_monsys();
  dbg->dbt = NewNameHash();

  if (OpenDB(dbg) != MCP_OK) {
    exit(1);
  }
  _monblob_export(dbg, ExportID, Socket);
  CloseDB(dbg);

  return 0;
}
开发者ID:montsuqi,项目名称:panda,代码行数:37,代码来源:monblobapi.c

示例11: SetDefault

void CTextStyle::FromOldStyle(const TextStyle& style)
{
	// Set some defaults.
	SetDefault();

	// Copy the style information over.
	Font(style.get_face());
	Size(MakeFixed(style.get_size(), style.get_size_fraction()));
	BaseSize(MakeFixed(style.get_base_size(), style.get_base_size_fraction()));
	Expansion(DivFixed(MakeFixed(style.get_base_size(), style.get_base_size_fraction()),
							 MakeFixed(FONT_EXPANSION_UNIT)));
	Fill(style.get_pattern(), style.get_color());
	Outline(style.get_outline(), style.get_color());
	Shadow(style.get_shadow(), style.get_color());
	m_Character.m_nEffectsVersion = 1;
	XFlipped(style.get_xflipped());
	YFlipped(style.get_yflipped());
//	Color(style.get_color());

	Alignment(style.get_line_alignment());
	VerticalAlignment(style.get_vertical_alignment());
	// Left and right margin should be zero (default) unless set by user.
	// This fixes a problem converting old warp text boxes - they should
	// always have zero margins!
	LeftMargin(0);
	RightMargin(0);
//	LeftMargin(PageToInches(style.get_left_margin()));
//	RightMargin(PageToInches(style.get_right_margin()));
	LeadingType(LEADING_lines);
	Leading(MakeFixed(0.875));

	Underline(style.UnderlineStyle());

	// Update our metrics.
	UpdateFontMetrics();
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:36,代码来源:TEXT.CPP

示例12: SetDefault

SytEvAdvData::SytEvAdvData()
{
    SetDefault();
}
开发者ID:llisper,项目名称:lite_client,代码行数:4,代码来源:ProtoSyt.cpp


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