mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-02 03:37:51 +00:00
Fixing framework.
This commit is contained in:
@@ -155,6 +155,16 @@ namespace ORM {
|
|||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::string to_string(const Poco::Data::BLOB &blob) {
|
||||||
|
auto Content = blob.content();
|
||||||
|
std::string result;
|
||||||
|
result.reserve(Content.size());
|
||||||
|
for(const auto &c:Content) {
|
||||||
|
result += (char) c;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
inline std::string to_string(const char * S) {
|
inline std::string to_string(const char * S) {
|
||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,19 +72,19 @@ namespace OpenWifi {
|
|||||||
if(GetRecord("id",Id,A)) {
|
if(GetRecord("id",Id,A)) {
|
||||||
Type = A.type;
|
Type = A.type;
|
||||||
Name = A.name;
|
Name = A.name;
|
||||||
if(StorageService()->Type() == DBType::pgsql) {
|
AvatarContent = ORM::to_string(A.avatar);
|
||||||
// Poco::Data::BLOBInputStream IL(A.avatar);
|
/* if(StorageService()->Type() == DBType::pgsql) {
|
||||||
|
Poco::Data::BLOBInputStream IL(A.avatar);
|
||||||
auto Content = A.avatar.content();
|
auto Content = A.avatar.content();
|
||||||
for(const auto &c:Content) {
|
for(const auto &c:Content) {
|
||||||
AvatarContent += (char) c;
|
AvatarContent += (char) c;
|
||||||
}
|
}
|
||||||
/* while(IL.std::basic_ios<char>::good()) {
|
|
||||||
|
while(IL.std::basic_ios<char>::good()) {
|
||||||
char buf[16000];
|
char buf[16000];
|
||||||
std::size_t Size = IL.readsome((unsigned char *)buf,16000);
|
std::size_t Size = IL.readsome((unsigned char *)buf,16000);
|
||||||
AvatarContent += std::string{buf,Size};
|
AvatarContent += std::string{buf,Size};
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
/*
|
|
||||||
Poco::StreamCopier::copyStream(IL, os);
|
Poco::StreamCopier::copyStream(IL, os);
|
||||||
IL.
|
IL.
|
||||||
std::string tmp = os.str().substr(2);
|
std::string tmp = os.str().substr(2);
|
||||||
@@ -92,16 +92,15 @@ namespace OpenWifi {
|
|||||||
for(size_t i=0;i<tmp.size(); i+=2) {
|
for(size_t i=0;i<tmp.size(); i+=2) {
|
||||||
AvatarContent += (char) (fromhex(tmp[i])*16 + fromhex(tmp[i+1]));
|
AvatarContent += (char) (fromhex(tmp[i])*16 + fromhex(tmp[i+1]));
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
Logger().information(fmt::format("Avatar size:4 {}", AvatarContent.size()));
|
Logger().information(fmt::format("Avatar size:4 {}", AvatarContent.size()));
|
||||||
} else {
|
} else {
|
||||||
/* Poco::Data::BLOBInputStream IL(A.avatar);
|
Poco::Data::BLOBInputStream IL(A.avatar);
|
||||||
std::ostringstream os("",std::ios_base::binary);
|
std::ostringstream os("",std::ios_base::binary);
|
||||||
Poco::StreamCopier::copyStream(IL, os);
|
Poco::StreamCopier::copyStream(IL, os);
|
||||||
AvatarContent = os.str();
|
AvatarContent = os.str();
|
||||||
Logger().information(fmt::format("Avatar size: {}", os.str().size()));
|
Logger().information(fmt::format("Avatar size: {}", os.str().size()));
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (const Poco::Exception &E) {
|
} catch (const Poco::Exception &E) {
|
||||||
|
|||||||
Reference in New Issue
Block a user