本文整理汇总了C++中CVariant::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ CVariant::GetData方法的具体用法?C++ CVariant::GetData怎么用?C++ CVariant::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVariant
的用法示例。
在下文中一共展示了CVariant::GetData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CVariant::CVariant(const CVariant& v)
: m_data(0)
{
if( v.GetData() != 0 ) {
m_data = v.GetData()->Clone();
}
}
示例2: SetParam
void CCallableStatement::SetParam(const CVariant& v,
const CDBParamVariant& param)
{
if (param.IsPositional()) {
// Decrement position by ONE.
GetRpcCmd()->GetBindParams().Set(param.GetPosition() - 1, v.GetData());
} else {
GetRpcCmd()->GetBindParams().Set(param, v.GetData());
}
}
示例3: LoadData
bool CKadScript::LoadData(const wstring& Path)
{
CVariant Data;
if(!ReadFile(Path, Data))
return false;
try
{
m_LastUsed = Data["LastUsed"].To<uint64>();
if(!m_LastUsed)
m_LastUsed = GetTime();
m_Data->Set(Data["Data"]);
if(Data.Has("KEY"))
{
CVariant SecretKey = Data["KEY"];
if(SecretKey.Decrypt(GetParent<CKademlia>()->Root()->GetID().GetPrivateKey()))
{
m_SecretKey = new CAbstractKey;
if(!m_SecretKey->SetKey(SecretKey.GetData(), SecretKey.GetSize()))
m_SecretKey = NULL;
}
}
m_Authentication = Data.Get("AUTH");
}
catch(const CException&)
{
return false;
}
return true;
}
示例4: ExecuteLast
void CStatement::ExecuteLast()
{
for(ParamList::iterator i = m_params.begin(); i != m_params.end(); ++i ) {
GetLangCmd()->GetBindParams().Bind((*i).first, (*i).second->GetData());
}
for(unsigned int i = 0; i < m_posParams.size(); ++i) {
CVariant* var = m_posParams[i];
if (!var) {
NCBI_DBAPI_THROW("Not all parameters were bound by position.");
}
GetLangCmd()->GetBindParams().Bind(i, var->GetData());
}
m_cmd->Send();
}
示例5: Init
void CUIntX::Init(const CVariant& Variant)
{
if(Variant.GetSize() != GetSize())
throw CException(LOG_ERROR | LOG_DEBUG, L"Variant is not a uInt128");
memcpy(GetData(), Variant.GetData(), GetSize());
}
示例6: StartLookup
CVariant CKademlia::StartLookup(const CUInt128& TargetID, const CVariant& CodeID, const TCallMap& Execute, const TStoreMap& Store, CPrivateKey* pStoreKey, const TLoadMap& Load
, int Timeout, int HopLimit, int JumpCount, int SpreadCount, bool bTrace, const wstring& Name)
{
if(!m_pKadHandler)
return CVariant();
if(!CodeID.IsValid() && Store.empty() && Load.empty())
{
LogLine(LOG_ERROR, L"Attempted to start an empty Lookup");
return CVariant();
}
CPointer<CKadTask> pLookup = new CKadTask(TargetID, m_pLookupManager);
pLookup->SetName(Name);
if(Timeout != -1)
pLookup->SetTimeOut(Timeout);
if(HopLimit != -1)
pLookup->SetHopLimit(HopLimit);
if(JumpCount != -1)
pLookup->SetJumpCount(JumpCount);
if(SpreadCount != -1)
pLookup->SetSpreadCount(SpreadCount);
if(bTrace)
pLookup->EnableTrace();
if(pStoreKey)
pLookup->SetStoreKey(pStoreKey);
for(TStoreMap::const_iterator I = Store.begin(); I != Store.end(); I++)
pLookup->Store(I->first, I->second.Path, I->second.Data);
for(TLoadMap::const_iterator I = Load.begin(); I != Load.end(); I++)
pLookup->Load(I->first, I->second.Path);
if(CodeID.IsValid())
{
if(!pLookup->SetupScript(CodeID))
{
LogLine(LOG_ERROR, L"Attempted to start a smart lookup with an unavailable script: %s", ToHex(CodeID.GetData(), CodeID.GetSize()).c_str());
return CVariant();
}
for(TCallMap::const_iterator I = Execute.begin(); I != Execute.end(); I++)
pLookup->AddCall(I->second.Function, I->second.Parameters, I->first);
}
CVariant LookupID = m_pLookupManager->StartLookup(pLookup.Obj());
return LookupID;
}