📄 dprecordtest.cxx
字号:
#include "DPRecord.hxx"
#include <iostream>
int main(void) {
DBConnection* dbconn = NULL;
cout << "Creating test record\n";
Record* rec = Record::createNewRecord(DPE_RECORD);
cout << "Created record :\n";
rec->displayRecord();
cout << "Checking record type ...\n";
cout << "Record Type : " << rec->getRecordTypeAsString();
cout << " (" << rec->getRecordType() << ")\n\n";
cout << "Setting key to '1' and populate record\n";
rec->populateRecord("1", dbconn);
// Now check and cast to a DPEntryRecord
DPEntryRecord* testRecord;
if (rec->getRecordType() != DPE_RECORD) {
return 0; // This shouldn't happen
}
testRecord = (DPEntryRecord*)rec;
// Now set the data
testRecord->setDP("nPlusOne");
testRecord->setKey("^sip:7000");
testRecord->setContact("sip:$USER@127.0.0.1:5110");
testRecord->setUserType(true);
testRecord->setPriority(1);
rec->displayRecord();
// Could now do an amend
rec->amendRecord(dbconn);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -