MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / GetDevInfo

Function GetDevInfo

Projects/sip_server/script.cpp:105–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105vector<SipServer::DevInfo*> GetDevInfo()
106{
107 vector<SipServer::DevInfo*> vecRet;
108 lua::Table rows = luafGetDevInfo();
109 for(auto it = rows.getBegin(); !it.isEnd(); it++){
110 lua::Var k,v;
111 it.getKeyValue(&k, &v);
112 if(!lua::VarType<lua::Table>(v))
113 continue;
114 SipServer::DevInfo *dev = new SipServer::DevInfo();
115 lua::Table row = lua::VarCast<lua::Table>(v);
116 for(auto rit = row.getBegin(); !rit.isEnd(); rit++){
117 lua::Var k2,v2;
118 rit.getKeyValue(&k2, &v2);
119 lua::Str key = lua::VarCast<lua::Str>(k2);
120 if(key == "DevID"){
121 lua::Str value = lua::VarCast<lua::Str>(v2);
122 dev->strDevID = value;
123 } else if(key == "Name"){
124 lua::Str value = lua::VarCast<lua::Str>(v2);
125 dev->strName = value;
126 } else if(key == "Manuf"){
127 lua::Str value = lua::VarCast<lua::Str>(v2);
128 dev->strManuf = value;
129 } else if(key == "Model"){
130 lua::Str value = lua::VarCast<lua::Str>(v2);
131 dev->strModel = value;
132 } else if(key == "Owner"){
133 lua::Str value = lua::VarCast<lua::Str>(v2);
134 dev->strOwner = value;
135 } else if(key == "CivilCode"){
136 lua::Str value = lua::VarCast<lua::Str>(v2);
137 dev->strCivilCode = value;
138 } else if(key == "Block"){
139 lua::Str value = lua::VarCast<lua::Str>(v2);
140 dev->strBlock = value;
141 } else if(key == "Address"){
142 lua::Str value = lua::VarCast<lua::Str>(v2);
143 dev->strAddress = value;
144 } else if(key == "Parental"){
145 lua::Str value = lua::VarCast<lua::Str>(v2);
146 dev->strParental = value;
147 } else if(key == "ParentID"){
148 lua::Str value = lua::VarCast<lua::Str>(v2);
149 dev->strParentID = value;
150 } else if(key == "SafetyWay"){
151 lua::Str value = lua::VarCast<lua::Str>(v2);
152 dev->strSafetyWay = value;
153 } else if(key == "RegisterWay"){
154 lua::Str value = lua::VarCast<lua::Str>(v2);
155 dev->strRegisterWay = value;
156 } else if(key == "CertNum"){
157 lua::Str value = lua::VarCast<lua::Str>(v2);
158 dev->strCertNum = value;
159 } else if(key == "Certifiable"){
160 lua::Str value = lua::VarCast<lua::Str>(v2);
161 dev->strCertifiable = value;
162 } else if(key == "ErrCode"){

Callers 1

InitFunction · 0.85

Calls 3

isEndMethod · 0.80
getKeyValueMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected