本文整理匯總了C++中GetConfiguration函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetConfiguration函數的具體用法?C++ GetConfiguration怎麽用?C++ GetConfiguration使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetConfiguration函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: reg_query_winscp_value_ex
long reg_query_winscp_value_ex(HKEY Key, const char * ValueName, unsigned long * /*Reserved*/,
unsigned long * Type, uint8_t * Data, unsigned long * DataSize)
{
long R;
DebugAssert(GetConfiguration() != nullptr);
THierarchicalStorage * Storage = reinterpret_cast<THierarchicalStorage *>(Key);
AnsiString Value;
if (Storage == nullptr)
{
if (UnicodeString(ValueName) == L"RandSeedFile")
{
Value = AnsiString(GetConfiguration()->GetRandomSeedFileName());
R = ERROR_SUCCESS;
}
else
{
DebugFail();
R = ERROR_READ_FAULT;
}
}
else
{
if (Storage->ValueExists(ValueName))
{
Value = AnsiString(Storage->ReadStringRaw(ValueName, L""));
R = ERROR_SUCCESS;
}
else
{
R = ERROR_READ_FAULT;
}
}
if (R == ERROR_SUCCESS)
{
DebugAssert(Type != nullptr);
*Type = REG_SZ;
char * DataStr = reinterpret_cast<char *>(Data);
int sz = static_cast<int>(*DataSize);
if (sz > 0)
{
strncpy(DataStr, Value.c_str(), sz);
DataStr[sz - 1] = '\0';
}
*DataSize = static_cast<uint32_t>(strlen(DataStr));
}
return R;
}
示例2: GetConfiguration
// get short name for loft
std::string CCPACSFuselage::GetShortShapeName ()
{
unsigned int findex = 0;
for (int i = 1; i <= GetConfiguration().GetFuselageCount(); ++i) {
tigl::CCPACSFuselage& f = GetConfiguration().GetFuselage(i);
if (GetUID() == f.GetUID()) {
findex = i;
std::stringstream shortName;
shortName << "F" << findex;
return shortName.str();
}
}
return "UNKNOWN";
}
示例3: GetConfiguration
int CMPIPTV_RTSP::Initialize(HANDLE lockMutex, CParameterCollection *configuration)
{
if (configuration != NULL)
{
CParameterCollection *vlcParameters = GetConfiguration(&this->logger, PROTOCOL_IMPLEMENTATION_NAME, METHOD_INITIALIZE_NAME, CONFIGURATION_SECTION_UDP);
configuration->Append(vlcParameters);
delete vlcParameters;
}
int result = this->CMPIPTV_UDP::Initialize(lockMutex, configuration);
this->receiveDataTimeout = this->configurationParameters->GetValueLong(CONFIGURATION_RTSP_RECEIVE_DATA_TIMEOUT, true, RTSP_RECEIVE_DATA_TIMEOUT_DEFAULT);
this->rtspUdpSinkMaxPayloadSize = this->configurationParameters->GetValueUnsignedInt(CONFIGURATION_RTSP_UDP_SINK_MAX_PAYLOAD_SIZE, true, RTSP_UDP_SINK_MAX_PAYLOAD_SIZE_DEFAULT);
this->rtspUdpPortRangeStart = this->configurationParameters->GetValueLong(CONFIGURATION_RTSP_UDP_PORT_RANGE_START, true, RTSP_UDP_PORT_RANGE_START_DEFAULT);
this->rtspUdpPortRangeEnd = this->configurationParameters->GetValueLong(CONFIGURATION_RTSP_UDP_PORT_RANGE_END, true, RTSP_UDP_PORT_RANGE_END_DEFAULT);
this->rtspTeardownRequestMaximumCount = this->configurationParameters->GetValueLong(CONFIGURATION_RTSP_TEARDOWN_REQUEST_MAXIMUM_COUNT, true, RTSP_TEARDOWN_REQUEST_MAXIMUM_COUNT_DEFAULT);
this->rtspTeardownRequestTimeout = this->configurationParameters->GetValueLong(CONFIGURATION_RTSP_TEARDOWN_REQUEST_TIMEOUT, true, RTSP_TEARDOWN_REQUEST_TIMEOUT_DEFAULT);
this->openConnetionMaximumAttempts = this->configurationParameters->GetValueLong(CONFIGURATION_RTSP_OPEN_CONNECTION_MAXIMUM_ATTEMPTS, true, RTSP_OPEN_CONNECTION_MAXIMUM_ATTEMPTS_DEFAULT);
this->receiveDataTimeout = (this->receiveDataTimeout < 0) ? RTSP_RECEIVE_DATA_TIMEOUT_DEFAULT : this->receiveDataTimeout;
this->rtspUdpSinkMaxPayloadSize = (this->rtspUdpSinkMaxPayloadSize < 0) ? RTSP_UDP_SINK_MAX_PAYLOAD_SIZE_DEFAULT : this->rtspUdpSinkMaxPayloadSize;
this->rtspUdpPortRangeStart = (this->rtspUdpPortRangeStart <= 1024) ? RTSP_UDP_PORT_RANGE_START_DEFAULT : this->rtspUdpPortRangeStart;
this->rtspUdpPortRangeEnd = (this->rtspUdpPortRangeEnd < this->rtspUdpPortRangeStart) ? min(65535, this->rtspUdpPortRangeStart + 1000) : min(65535, this->rtspUdpPortRangeEnd);
this->rtspTeardownRequestMaximumCount = (this->rtspTeardownRequestMaximumCount <= 0) ? RTSP_TEARDOWN_REQUEST_MAXIMUM_COUNT_DEFAULT : this->rtspTeardownRequestMaximumCount;
this->rtspTeardownRequestTimeout = (this->rtspTeardownRequestTimeout < 0) ? RTSP_TEARDOWN_REQUEST_TIMEOUT_DEFAULT : this->rtspTeardownRequestTimeout;
this->openConnetionMaximumAttempts = (this->openConnetionMaximumAttempts < 0) ? RTSP_OPEN_CONNECTION_MAXIMUM_ATTEMPTS_DEFAULT : this->openConnetionMaximumAttempts;
this->rtspScheduler = RtspTaskScheduler::createNew();
this->rtspEnvironment = BasicUsageEnvironment::createNew(*this->rtspScheduler);
result |= (this->rtspScheduler == NULL);
result |= (this->rtspEnvironment == NULL);
return (result == STATUS_OK) ? STATUS_OK : STATUS_ERROR;
}
示例4: GetDlgItem
void CWorkspacePreferencesDialog::OnOK()
{
#if 0
if (GetFocus() == GetDlgItem(IDC_WORKSPACE_SIZE))
{
GetDlgItem(IDOK)->SetFocus();
}
else
#endif
if (OnValidateWorkspaceSize(0, 0L))
{
/* Check that the number they typed is valid. */
DWORD dwAvailableSize = Util::GetAvailableDiskSpace(m_csWorkspaceDirectory);
dwAvailableSize += m_cache->get_physical_size();
if (m_dwWorkspaceSize > dwAvailableSize)
{
/*
// This is not a good idea.
// Inform the user that a lower number is required.
*/
GetConfiguration()->MessageBox(IDS_ErrWorkspaceExceedsDiskSpace, 0,
MB_OK | MB_ICONEXCLAMATION);
GetDlgItem(IDC_WORKSPACE_SIZE)->SetFocus();
}
else
{
/* Go home. */
CPmwDialog::OnOK();
}
}
}
示例5: BuildFromURI
VSIOSSHandleHelper* VSIOSSHandleHelper::BuildFromURI( const char* pszURI,
const char* pszFSPrefix,
bool bAllowNoObject,
CSLConstList papszOptions )
{
CPLString osSecretAccessKey;
CPLString osAccessKeyId;
if( !GetConfiguration(papszOptions, osSecretAccessKey, osAccessKeyId) )
{
return nullptr;
}
const CPLString osEndpoint = CSLFetchNameValueDef(papszOptions,
"OSS_ENDPOINT",
CPLGetConfigOption("OSS_ENDPOINT", "oss-us-east-1.aliyuncs.com"));
CPLString osBucket;
CPLString osObjectKey;
if( pszURI != nullptr && pszURI[0] != '\0' &&
!GetBucketAndObjectKey(pszURI, pszFSPrefix, bAllowNoObject,
osBucket, osObjectKey) )
{
return nullptr;
}
const bool bUseHTTPS = CPLTestBool(CPLGetConfigOption("OSS_HTTPS", "YES"));
const bool bIsValidNameForVirtualHosting =
osBucket.find('.') == std::string::npos;
const bool bUseVirtualHosting = CPLTestBool(
CPLGetConfigOption("OSS_VIRTUAL_HOSTING",
bIsValidNameForVirtualHosting ? "TRUE" : "FALSE"));
return new VSIOSSHandleHelper(osSecretAccessKey, osAccessKeyId,
osEndpoint,
osBucket, osObjectKey, bUseHTTPS,
bUseVirtualHosting);
}
示例6: CHECK_LT
void VideoFormats::getProfileLevel(
ResolutionType type, size_t index,
ProfileType *profile, LevelType *level) const{
CHECK_LT(type, kNumResolutionTypes);
CHECK(GetConfiguration(type, index, NULL, NULL, NULL, NULL));
int i, bestProfile = -1, bestLevel = -1;
for (i = 0; i < kNumProfileTypes; ++i) {
if (mConfigs[type][index].profile & (1ul << i)) {
bestProfile = i;
}
}
for (i = 0; i < kNumLevelTypes; ++i) {
if (mConfigs[type][index].level & (1ul << i)) {
bestLevel = i;
}
}
if (bestProfile == -1 || bestLevel == -1) {
ALOGE("Profile or level not set for resolution type %d, index %d",
type, index);
bestProfile = PROFILE_CBP;
bestLevel = LEVEL_31;
}
*profile = (ProfileType) bestProfile;
*level = (LevelType) bestLevel;
}
示例7: main
int main()
{
const char *configuration = GetConfiguration();
printf("Configuration is '%s'\n", configuration);
return 0;
}
示例8: set_card_panel_view
VOID CCardView::set_card_panel_view(SHORT new_panel)
{
/*
// If this is a demo card back, then we don't allow editing.
*/
if ((new_panel == CARD_PANEL_Back) && !GetConfiguration()->SupportsCardBack())
{
return;
}
#if 1
BeforePageChange();
SetPanel(new_panel);
#else
/*
// Get the document and build the undo/redo command for this.
*/
CPmwDoc* pDoc = GetDocument();
CCmdCardPanel* pCommand = new CCmdCardPanel(IDCmd_Panel[new_panel+1]);
if (pCommand->Snapshot(this, pDoc->get_current_panel(), new_panel))
{
pDoc->AddCommand(pCommand);
}
else
{
delete pCommand;
/* Fall through. */
// SetPanel(new_panel);
}
#endif
}
示例9: IsBonusEnabled
REGRESULT CRegisterDLL::IsBonusEnabled(void)
{
#ifdef LOCALIZE
if (GetConfiguration()->RemoveRegistration())
return REGRESULT_AlreadyRegistered;
#endif
return RegSendCommand(REGCOMMAND_IsBonusEnabled);
}
示例10: RegisterBonus
REGRESULT CRegisterDLL::RegisterBonus(void)
{
#ifdef LOCALIZE
if (GetConfiguration()->RemoveRegistration())
return TRUE;
#endif
return RegSendCommand(REGCOMMAND_Register " /C /A");
}
示例11: GetConfiguration
status_t ArpAccentRandomizerFilter::Configure(ArpVectorI<BView*>& panels)
{
BMessage config;
status_t err = GetConfiguration(&config);
if (err != B_OK) return err;
panels.push_back(new ArpAccentRandomizerFilterSettings(mHolder, config));
return B_OK;
}
示例12: GetConfiguration
status_t ArpUncertainChorusFilter::Configure(ArpVectorI<BView*>& panels)
{
BMessage config;
status_t err = GetConfiguration(&config);
if (err != B_OK) return err;
panels.push_back(new ArpUncertainChorusSettings(mHolder, config));
return B_OK;
}
示例13: GetConfiguration
status_t ArpControllerRangeFilter::Configure(ArpVectorI<BView*>& panels)
{
BMessage config;
status_t err = GetConfiguration(&config);
if (err != B_OK) return err;
panels.push_back(new _ControllerRangeSettings(mHolder, config));
return B_OK;
}
示例14: GetConfiguration
int CAEN_V814::Config(BoardConfig *bC)
{
Board::Config(bC);
//Set All Configuration to 0
for (unsigned int i=0;i<CAEN_V814_CHANNELS;++i)
GetConfiguration()->chThreshold[i]=0;
//here the parsing of the xmlnode...
GetConfiguration()->baseAddress=Configurator::GetInt( bC->getElementContent("baseAddress"));
GetConfiguration()->patternMask=Configurator::GetInt( bC->getElementContent("patternMask"));
GetConfiguration()->outputWidth=Configurator::GetInt( bC->getElementContent("outputWidth"));
GetConfiguration()->majorityThreshold=Configurator::GetInt( bC->getElementContent("majorityThreshold"));
GetConfiguration()->commonThreshold=Configurator::GetInt( bC->getElementContent("commonThreshold"));
//Now threshold per channel if they exist in configuration
char chThresholdKey[100];
for (unsigned int i=0;i<CAEN_V814_CHANNELS;++i)
{
sprintf(chThresholdKey,"ch%dThreshold",i);
if (bC->getElementContent(chThresholdKey) == "NULL")
continue;
GetConfiguration()->chThreshold[i]==(int)Configurator::GetInt( bC->getElementContent(chThresholdKey) );
}
return 0;
}
示例15: CoreLoad
void CoreLoad()
{
bool SessionList = false;
std::unique_ptr<THierarchicalStorage> SessionsStorage(GetConfiguration()->CreateStorage(SessionList));
THierarchicalStorage * ConfigStorage = nullptr;
std::unique_ptr<THierarchicalStorage> ConfigStorageAuto;
if (!SessionList)
{
// can reuse this for configuration
ConfigStorage = SessionsStorage.get();
}
else
{
ConfigStorageAuto.reset(GetConfiguration()->CreateConfigStorage());
ConfigStorage = ConfigStorageAuto.get();
}
assert(GetConfiguration() != nullptr);
try
{
GetConfiguration()->Load(ConfigStorage);
}
catch (Exception & E)
{
ShowExtendedException(&E);
}
// should be noop, unless exception occurred above
ConfigStorage->CloseAll();
StoredSessions = new TStoredSessionList();
try
{
if (SessionsStorage->OpenSubKey(GetConfiguration()->GetStoredSessionsSubKey(), false))
{
StoredSessions->Load(SessionsStorage.get());
}
}
catch (Exception & E)
{
ShowExtendedException(&E);
}
}