X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/2dd96d1468a065ebee3e37b1defcf2c438d72e2f..fd947779e36534941c5d7516ba34e4da21b8406b:/projects/stargazer/plugins/other/smux/sensors.cpp diff --git a/projects/stargazer/plugins/other/smux/sensors.cpp b/projects/stargazer/plugins/other/smux/sensors.cpp index 48809032..6018566c 100644 --- a/projects/stargazer/plugins/other/smux/sensors.cpp +++ b/projects/stargazer/plugins/other/smux/sensors.cpp @@ -1,4 +1,4 @@ -#include "asn1/INTEGER.h" +#include "stg/INTEGER.h" #include "stg/user.h" @@ -23,3 +23,26 @@ users.CloseSearch(handle); ValueToOS(count, objectSyntax); return true; } + +#ifdef DEBUG +std::string UsersSensor::ToString() const +{ +int handle = users.OpenSearch(); +if (!handle) + return ""; + +USER_PTR user; +size_t count = 0; +while (!users.SearchNext(handle, &user)) + { + if (UserPredicate(user)) + ++count; + } + +users.CloseSearch(handle); + +std::string res; +x2str(count, res); +return res; +} +#endif