本文整理汇总了C++中CppSQLite3Query::getInt64Field方法的典型用法代码示例。如果您正苦于以下问题:C++ CppSQLite3Query::getInt64Field方法的具体用法?C++ CppSQLite3Query::getInt64Field怎么用?C++ CppSQLite3Query::getInt64Field使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CppSQLite3Query
的用法示例。
在下文中一共展示了CppSQLite3Query::getInt64Field方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCapacityInfo
int CStorageUnitInfoTable::GetCapacityInfo(const char* buf, sCapacityInfo *pInfo)
{
if(!m_pDB)
{
cout<<"Invalid Sqlite"<<endl;
return -1;
}
try
{
CppSQLite3Query q = m_pDB->execQuery(buf);
if(!q.eof())
{
pInfo->m_sumCap = q.getInt64Field("sumCapacity");
pInfo->m_declaredCap = q.getInt64Field("declaredCapacity");
pInfo->m_usedCap = q.getInt64Field("usedCapacity");
}
else
return -1;
}
catch(CppSQLite3Exception e)
{
cerr<<"CStorageUnitInfoTable::GetCapacityInfo:"<<e.errorCode()<<" "<<e.errorMessage()<<endl;
}
return 0;
}
示例2: GetSysCapacityInfo
int CStorageUnitInfoTable::GetSysCapacityInfo(sCapacityInfo *pInfo)
{
char buf[MAX_BUF_LEN];
memset(buf, 0, MAX_BUF_LEN);
sprintf(buf, "select sum(sumCapacity), sum(declaredCapacity), sum(usedCapacity) from %s", m_strTableName.c_str());
if(!m_pDB)
{
cout<<"Invalid Sqlite"<<endl;
return -1;
}
try
{
CppSQLite3Query q = m_pDB->execQuery(buf);
if(!q.eof())
{
pInfo->m_sumCap = q.getInt64Field(0);
pInfo->m_declaredCap = q.getInt64Field(1);
pInfo->m_usedCap = q.getInt64Field(2);
}
else
return -1;
}
catch(CppSQLite3Exception e)
{
cerr<<"CStorageUnitInfoTable::GetSysCapacityInfo:"<<e.errorCode()<<" "<<e.errorMessage()<<endl;
}
return 0;
}
示例3: RetrieveToken
tstring CBrainMemory::RetrieveToken(int64 RoomID){
int64 CurrentRoomValue,RoomType;
int64 CurrentID = RoomID;
//首先得到意义空间的信息
if(!GetRoomInfo(RoomID,CurrentRoomValue,RoomType)){
return NULL;
}
deque<int64> BodyList;
while(1)
{
//向上漫游,找到父空间空间的ID和逻辑明文,得记忆的形ID
CppSQLite3Query Result = LBrainQuery("*",CurrentRoomValue,LB_CHILD_ID,CurrentID);
if(Result.eof())return 0;
CurrentID = Result.getInt64Field(0); //fatherID
if(CurrentID == ROOT_SPACE)break;;
CurrentRoomValue = Result.getInt64Field(1); //fatherValuse
BodyList.push_front(CurrentRoomValue);
}
tstring s;
for (int i=0; i<BodyList.size(); i++)
{
int64 ID = BodyList[i];
TCHAR ch = (TCHAR)ID;
s += ch;
}
return s;
}
示例4: GetAllVisiter
void GetAllVisiter(int64 ParentID, vector<int64>& VisiterList,int64 NotIncludeChildID/*=0*/){
char TableName[30];
int64toa(ParentID,TableName);
if(!GetWorldDB().tableExists(TableName)){
return ;
}
CppSQLite3Buffer SQL;
SQL.format("select %s from \"%s\" where %s>%d",
ITEM_ID,
TableName,
ITEM_TYPE,
OBJECT_SPACE
);
CppSQLite3Query Result = GetWorldDB().execQuery(SQL);
if(Result.eof())return ;
while(!Result.eof()){
int64 ChildID = Result.getInt64Field(0);
if (ChildID != NotIncludeChildID)
{
VisiterList.push_back(ChildID);
}
Result.nextRow();
}
}
示例5: SQLToDocumentAttachmentDataArray
bool CWizIndexBase::SQLToDocumentAttachmentDataArray(const CString& strSQL,
CWizDocumentAttachmentDataArray& arrayAttachment)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
while (!query.eof())
{
WIZDOCUMENTATTACHMENTDATA data;
data.strKbGUID = kbGUID();
data.strGUID = query.getStringField(documentattachmentATTACHMENT_GUID);
data.strDocumentGUID = query.getStringField(documentattachmentDOCUMENT_GUID);
data.strName = query.getStringField(documentattachmentATTACHMENT_NAME);
data.strURL = query.getStringField(documentattachmentATTACHMENT_URL);
data.strDescription = query.getStringField(documentattachmentATTACHMENT_DESCRIPTION);
data.tInfoModified = query.getTimeField(documentattachmentDT_INFO_MODIFIED);
data.strInfoMD5 = query.getStringField(documentattachmentATTACHMENT_INFO_MD5);
data.tDataModified = query.getTimeField(documentattachmentDT_DATA_MODIFIED);
data.strDataMD5 = query.getStringField(documentattachmentATTACHMENT_DATA_MD5);
data.nVersion = query.getInt64Field(documentattachmentVersion);
arrayAttachment.push_back(data);
query.nextRow();
}
std::sort(arrayAttachment.begin(), arrayAttachment.end());
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}
示例6: GetAllMeaning
/*
int32 CBrainMemory::GetAllMeaning(int64 ID, map<int64,int64>
&MeaningList){
CppSQLite3Buffer SQL;
CppSQLite3Query Result;
char a[30];
char b[30];
MeaningList.clear();
// if(!RBrainHasTable(ID))return 0;
ToRBrain(ID);
SQL.format("select %s, %s from \"%s\" where %s=\"%s\" ;",
RB_SPACE_ID,
RB_SPACE_VALUE,
_i64toa(ID,a,10),
RB_SPACE_TYPE,
_i64toa(MEMORY_TYPE_MEANING,b,10)
);
Result = BrainDB.execQuery(SQL);
while(!Result.eof())
{
MeaningList[Result.getInt64Field(1)] = Result.getInt64Field(0);
Result.nextRow();
}
return MeaningList.size();
}
*/
int32 CBrainMemory::GetAllMeaningRoomID(int64 ID, deque<int64>& MeaningRoomIDList){
CppSQLite3Buffer SQL;
CppSQLite3Query Result;
char a[30],b[30];
MeaningRoomIDList.clear();
// if(!RBrainHasTable(ID))return 0;
ToRBrain(ID);
int64toa(ID,a);
int64toa(MEMORY_BODY,b);
SQL.format("select %s from \"%s\" where %s > \"%s\";",
RB_SPACE_ID,
a,
RB_SPACE_TYPE,
b
);
Result = BrainDB.execQuery(SQL);
while(!Result.eof())
{
MeaningRoomIDList.push_back(Result.getInt64Field(0));
Result.nextRow();
}
return MeaningRoomIDList.size();
}
示例7: SQLToTagDataArray
bool CWizIndexBase::SQLToTagDataArray(const CString& strSQL, CWizTagDataArray& arrayTag)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
while (!query.eof())
{
WIZTAGDATA data;
data.strKbGUID = kbGUID();
data.strGUID = query.getStringField(tagTAG_GUID);
data.strParentGUID = query.getStringField(tagTAG_GROUP_GUID);
data.strName = query.getStringField(tagTAG_NAME);
data.strDescription = query.getStringField(tagTAG_DESCRIPTION);
data.tModified = query.getTimeField(tagDT_MODIFIED);
data.nVersion = query.getInt64Field(tagVersion);
arrayTag.push_back(data);
query.nextRow();
}
std::sort(arrayTag.begin(), arrayTag.end());
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}
示例8: SQLToStyleDataArray
bool CWizIndexBase::SQLToStyleDataArray(const CString& strSQL, CWizStyleDataArray& arrayStyle)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
while (!query.eof())
{
WIZSTYLEDATA data;
data.strKbGUID = kbGUID();
data.strGUID = query.getStringField(styleSTYLE_GUID);
data.strName = query.getStringField(styleSTYLE_NAME);
data.strDescription = query.getStringField(styleSTYLE_DESCRIPTION);
data.crTextColor = query.getColorField(styleSTYLE_TEXT_COLOR);
data.crBackColor = query.getColorField(styleSTYLE_BACK_COLOR);
data.bTextBold = query.getBoolField(styleSTYLE_TEXT_BOLD);
data.nFlagIndex = query.getIntField(styleSTYLE_FLAG_INDEX);
data.tModified = query.getTimeField(styleDT_MODIFIED);
data.nVersion = query.getInt64Field(styleVersion);
arrayStyle.push_back(data);
query.nextRow();
}
std::sort(arrayStyle.begin(), arrayStyle.end());
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}
示例9: GetChildType
int64 CBrainMemory::GetChildType(int64 ParentRoomID,int64 ChildRoomID){
ToRBrain(ParentRoomID);
if(!RBrainHasTable(ParentRoomID))return 0;
CppSQLite3Buffer SQL;
CppSQLite3Query Result;
char a[30],b[30];
assert(ChildRoomID != 0 );
int64toa(ParentRoomID,a);
int64toa(ChildRoomID,b);
SQL.format("select \"%s\" from \"%s\" where \"%s\" = \"%s\" ",
RB_SPACE_TYPE,
a,
RB_SPACE_ID,
b
);
Result = BrainDB.execQuery(SQL);
if(Result.eof())return 0;
int64 ChildType = Result.getInt64Field(0);
return ChildType;
};
示例10: GetChildID
int64 CBrainMemory::GetChildID(int64 ParentRoom,int64 ChildRoomValue,int64 ChildRoomType)
{
ToRBrain(ParentRoom);
int64 ChildID;
if(!RBrainHasTable(ParentRoom))return 0;
CppSQLite3Buffer SQL;
CppSQLite3Query Result;
char a[30],b[30],c[30];
assert(ChildRoomValue != 0 || ChildRoomType != 0);
int64toa(ParentRoom,a);
int64toa(ChildRoomValue,b);
int64toa(ChildRoomType,c);
SQL.format("select \"%s\" from \"%s\" where \"%s\" = \"%s\" and \"%s\" = %s;",
RB_SPACE_ID,
a,
RB_SPACE_VALUE,
b,
RB_SPACE_TYPE,
c
);
Result = BrainDB.execQuery(SQL);
if(Result.eof())return 0;
ChildID = Result.getInt64Field(0);
return ChildID;
}
示例11: RetrieveObject
//返回一个Ojbect/people的存储路径,不包括CRC32
uint32 CBrainMemory::RetrieveObject(int64 RoomID,tstring& Text){
int64 CurrentRoomValue,RoomType;
int64 CurrentID = RoomID;
//首先得到意义空间的信息
GetRoomInfo(RoomID,CurrentRoomValue,RoomType);
if (RoomType == MEMORY_OBJECT){
Text = _T("Object: ");
}else if(RoomType == MEMORY_PEOPLE)
{
Text = _T("People: ");
}else return 0;
uint32 crc = CurrentRoomValue;
deque<int64> MeaingList;
while(1)
{
//向上漫游,找到父空间空间的ID和逻辑明文,得记忆的形ID
CppSQLite3Query Result = LBrainQuery("*",CurrentRoomValue,LB_CHILD_ID,CurrentID);
if(Result.eof())return 0;
CurrentID = Result.getInt64Field(0); //fatherID
if(CurrentID == ROOT_SPACE)break;;
CurrentRoomValue = Result.getInt64Field(1); //fatherValuse
MeaingList.push_front(CurrentRoomValue);
}
deque<int64>::iterator It = MeaingList.begin();
deque<int64>::iterator ItEnd = MeaingList.end();
int64 ID = *It;
IP ip((uint32)ID);
AnsiString s = ip.Get();
tstring ws = UTF8toWS(s);
Text += ws;
It++;
tstring Name;
while (It <ItEnd){
ID = *It;
Text += _T("\\");
if(!RetrieveText(ID,Name))return 0;
Text +=Name;
Name=_T("");
It++;
};
return crc;
}
示例12: SQLToDocumentDataArray
bool CWizIndexBase::SQLToDocumentDataArray(const CString& strSQL, CWizDocumentDataArray& arrayDocument)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
CWizStdStringArray arrayGUID;
std::map<CString, int> mapDocumentIndex;
while (!query.eof())
{
WIZDOCUMENTDATA data;
data.strKbGUID = kbGUID();
data.strGUID = query.getStringField(documentDOCUMENT_GUID);
data.strTitle = query.getStringField(documentDOCUMENT_TITLE);
data.strLocation = query.getStringField(documentDOCUMENT_LOCATION);
data.strName = query.getStringField(documentDOCUMENT_NAME);
data.strSEO = query.getStringField(documentDOCUMENT_SEO);
data.strURL = query.getStringField(documentDOCUMENT_URL);
data.strAuthor = query.getStringField(documentDOCUMENT_AUTHOR);
data.strKeywords = query.getStringField(documentDOCUMENT_KEYWORDS);
data.strType = query.getStringField(documentDOCUMENT_TYPE);
data.strOwner = query.getStringField(documentDOCUMENT_OWNER);
data.strFileType = query.getStringField(documentDOCUMENT_FILE_TYPE);
data.strStyleGUID = query.getStringField(documentSTYLE_GUID);
data.tCreated = query.getTimeField(documentDT_CREATED);
data.tModified = query.getTimeField(documentDT_MODIFIED);
data.tAccessed = query.getTimeField(documentDT_ACCESSED);
data.nIconIndex = query.getIntField(documentDOCUMENT_ICON_INDEX);
data.nSync = query.getIntField(documentDOCUMENT_SYNC);
data.nProtected = query.getIntField(documentDOCUMENT_PROTECT);
data.nReadCount = query.getIntField(documentDOCUMENT_READ_COUNT);
data.nAttachmentCount = query.getIntField(documentDOCUMENT_ATTACHEMENT_COUNT);
data.nIndexed = query.getIntField(documentDOCUMENT_INDEXED);
data.tInfoModified = query.getTimeField(documentDT_INFO_MODIFIED);
data.strInfoMD5 = query.getStringField(documentDOCUMENT_INFO_MD5);
data.tDataModified = query.getTimeField(documentDT_DATA_MODIFIED);
data.strDataMD5 = query.getStringField(documentDOCUMENT_DATA_MD5);
data.tParamModified = query.getTimeField(documentDT_PARAM_MODIFIED);
data.strParamMD5 = query.getStringField(documentDOCUMENT_PARAM_MD5);
data.nVersion = query.getInt64Field(documentVersion);
arrayGUID.push_back(data.strGUID);
arrayDocument.push_back(data);
mapDocumentIndex[data.strGUID] = int(arrayDocument.size() - 1);
query.nextRow();
}
if (!arrayGUID.empty()) {
InitDocumentExFields(arrayDocument, arrayGUID, mapDocumentIndex);
}
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}
示例13: RefreshBudgetGrid
void BudgetWindow::RefreshBudgetGrid(void)
{
fIncomeGrid.MakeEmpty();
fSpendingGrid.MakeEmpty();
CppSQLite3Query query = gDatabase.DBQuery("select category,amount,period from "
"budgetlist order by category",
"BudgetWindow::RefreshCategories");
while(!query.eof())
{
BString cat = DeescapeIllegalCharacters(query.getStringField(0));
Fixed amount;
amount.SetPremultiplied(query.getInt64Field(1));
BudgetPeriod period = (BudgetPeriod)query.getIntField(2);
ReportGrid *grid = (amount.IsPositive()) ? &fIncomeGrid : &fSpendingGrid;
int32 index = grid->CountItems();
grid->AddItem();
grid->SetRowTitle(index, cat.String());
Fixed f(amount.AbsoluteValue());
switch(period)
{
case BUDGET_QUARTERLY:
{
f /= 3;
Fixed qamt(amount);
qamt *= 4;
grid->SetValue(12,index,qamt);
break;
}
case BUDGET_ANNUALLY:
{
f /=12;
grid->SetValue(12,index,amount);
break;
}
default:
{
Fixed mamt(f);
mamt *= 12;
grid->SetValue(12,index,mamt);
break;
}
}
for(int32 i=0; i<12; i++)
grid->SetValue(i,index,f);
query.nextRow();
}
}
示例14: RetrieveLogic
//返回一段逻辑,存储为可编译状态
bool CBrainMemory::RetrieveLogic(int64 RoomID,ePipeline* Pipe,bool IsShunt/* = false*/){
int64 CurrentRoomValue,RoomType;
int64 CurrentID = RoomID;
//首先得到意义空间的信息
GetRoomInfo(RoomID,CurrentRoomValue,RoomType);
if(RoomType == MEMORY_ACT){ //递归终止
return RetrieveAction(RoomID,CurrentRoomValue,Pipe,IsShunt);
}
if(RoomType != MEMORY_SERIES &&
RoomType != MEMORY_SHUNT)return false;
int64 LogicType = RoomType;
deque<int64> MeaingList;
while(1)
{
//向上漫游,找到父空间空间的ID和逻辑明文,得记忆的形ID
CppSQLite3Query Result = LBrainQuery("*",CurrentRoomValue,LB_CHILD_ID,CurrentID);
if(Result.eof())return false;
CurrentID = Result.getInt64Field(0); //fatherID
if(CurrentID == ROOT_SPACE)break;
CurrentRoomValue = Result.getInt64Field(1); //fatherValuse
MeaingList.push_back(CurrentRoomValue);
}
IsShunt = RoomType == MEMORY_SHUNT;
deque<int64>::reverse_iterator It = MeaingList.rbegin();
while (It != MeaingList.rend())
{
CurrentRoomValue = *It;
ePipeline* ChildPipe = new ePipeline;
Pipe->Push_Directly(ChildPipe);
if (!RetrieveLogic(CurrentRoomValue,ChildPipe,IsShunt))return false;
It++;
}
return true;
}
示例15: SQLToSize
bool CWizIndexBase::SQLToSize(const CString& strSQL, int& size)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
size = query.getInt64Field(0);
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}