10 Poco::Latin1Encoding latin1;
11 Poco::UTF8Encoding utf8;
12 Poco::TextConverter text_converter(latin1, utf8);
13 std::string utf8_string;
14 text_converter.convert(latin_string, utf8_string);
20 Poco::Windows1252Encoding win1252;
21 Poco::UTF8Encoding utf8;
22 Poco::TextConverter text_converter(win1252, utf8);
23 std::string utf8_string;
24 text_converter.convert(win_string, utf8_string);
53 m_ts.fromEpochTime(time(NULL));
75 size_t n = strlen(xml_str);
82 if (xml_str[i] ==
'&')
85 for(j=0; !done_escape && (j <
sizeof(
escape_sequence) /
sizeof(
const char*)); j++)
87 if (strncmp(xml_str+i, escape_sequence[j], escape_length[j]) == 0)
89 s.push_back(*(escape_replace[j]));
90 i += escape_length[j];
95 if ( !done_escape && (xml_str[i+1] ==
'#') )
97 sscanf(xml_str+i,
"&#%d;", &j);
99 i = i + 4 + (j > 9 ? 1 : 0) + (j > 99 ? 1 : 0);
105 s.push_back(xml_str[i]);
111 s.push_back(xml_str[i]);
122 size_t n = strlen(xml_str);
128 else if (*xml_str ==
'<')
130 else if (*xml_str ==
'>')
132 else if (*xml_str ==
'\"')
134 else if (*xml_str ==
'\'')
136 else if (*xml_str & 128)
143 if ((ch & 0xe0) == 0xc0)
145 ch = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
148 else if ((ch & 0xf0) == 0xe0)
150 ch = ((((ch * 0x0f) << 6) | (s[1] & 0x3f)) << 6) | (s[2] & 0x3f);
163 sprintf(buffer,
"&#x%x;", ch);
169 s.push_back(*xml_str);
177 double ICPTimer::info(
const char* title, std::ostream& os,
bool add_nl)
180 double tdiff1ms = ( (tim_end.
m_tb.millitm -
m_tb.millitm) +
181 1000.0 * difftime(tim_end.
m_tb.time,
m_tb.time) );
182 double tdiff1 = tdiff1ms / 1000.0;
184 double tdiff2 = 3600.0 * (double)(tim_end.
m_st.wHour -
m_st.wHour) +
185 60.0 * (double)(tim_end.
m_st.wMinute -
m_st.wMinute) +
186 (double)(tim_end.
m_st.wSecond -
m_st.wSecond) +
187 (double)(tim_end.
m_st.wMilliseconds -
m_st.wMilliseconds) / 1000.0;
188 double tdiff3 =
m_ts.elapsed() / 1.0e6;
189 os <<
"*** Timing information for " << title <<
": real(" << tdiff3 <<
200 std::ostringstream oss;
201 double d =
info(title, oss,
false);
206 void AddEventSource( PCTSTR pszName, PCTSTR pszMessageFile, DWORD dwCategoryCount)
210 TCHAR szPath[ MAX_PATH ];
213 _T(
"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\%s"),
217 dwError = RegCreateKey( HKEY_LOCAL_MACHINE, szPath, &hRegKey );
220 GetModuleFileName( NULL, szPath, MAX_PATH );
223 dwError = RegSetValueEx( hRegKey,
224 _T(
"EventMessageFile"), 0, REG_EXPAND_SZ,
225 (PBYTE) pszMessageFile, (_tcslen( pszMessageFile) + 1) *
sizeof TCHAR );
228 DWORD dwTypes = EVENTLOG_ERROR_TYPE |
229 EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE | EVENTLOG_SUCCESS;
230 dwError = RegSetValueEx( hRegKey, _T(
"TypesSupported"), 0, REG_DWORD,
231 (LPBYTE) &dwTypes,
sizeof dwTypes );
238 if( dwCategoryCount > 0 ) {
240 dwError = RegSetValueEx( hRegKey, _T(
"CategoryMessageFile"),
241 0, REG_EXPAND_SZ, (PBYTE) szPath,
242 (_tcslen( szPath) + 1) *
sizeof TCHAR );
244 dwError = RegSetValueEx( hRegKey, _T(
"CategoryCount"), 0, REG_DWORD,
245 (PBYTE) &dwCategoryCount,
sizeof dwCategoryCount );
248 RegCloseKey( hRegKey );
255 struct stat stat_buffer;
258 if (stat(filename, &stat_buffer) != 0)
262 FILE* f = _fsopen(filename,
"rbN", _SH_DENYNO);
267 len = stat_buffer.st_size;
268 unsigned char* buffer =
new unsigned char[len];
269 fread(buffer, 1, len, f);
282 static HINSTANCE hcrypt = 0;
286 hcrypt = LoadLibrary(
"cryptdll.dll");
290 "cannot load cryptdll.dll");
293 MD5Init = (
MD5Init_t)GetProcAddress(hcrypt,
"MD5Init");
294 MD5Update = (
MD5Update_t)GetProcAddress(hcrypt,
"MD5Update");
295 MD5Final = (
MD5Final_t)GetProcAddress(hcrypt,
"MD5Final");
300 "cannot find MD5Init in cryptdll.dll");
304 (*MD5Init)(&context);
305 (*MD5Update)(&context, (
const unsigned char*)buffer, len);
306 (*MD5Final)(&context);
307 memcpy((
char*)md5sum, (
const char*)context.digest,
sizeof(context.digest));
318 sum = sum + md5sum1[i] + md5sum2[i];
319 if (md5sum1[i] != md5sum2[i])
341 spec_from = spec_to = 0;
342 i = spec_range.find(
'[');
343 j = spec_range.find(
':');
344 k = spec_range.find(
']');
345 if (i == std::string::npos || j == std::string::npos || k == std::string::npos)
349 spec_from = atoi(spec_range.substr(i+1,j-i-1).c_str());
350 spec_to = atoi(spec_range.substr(j+1,k-j-1).c_str());
360 s << (unsigned)checksum[i];
377 memset(
this, 0,
sizeof(OVERLAPPED));
390 data = strdup(data_);
395 if (
h != INVALID_HANDLE_VALUE)
417 GetQueuedCompletionStatus(file_complete, &ntrans, &key, (OVERLAPPED**)&overlapped, INFINITE);
418 (*(overlapped->
func))(overlapped->
arg);
426 if (file_complete == NULL)
428 file_complete = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, NULL, 1);
432 HANDLE h = CreateFile(filename, FILE_APPEND_DATA, FILE_SHARE_READ | FILE_SHARE_WRITE,
434 if (h != INVALID_HANDLE_VALUE)
436 CreateIoCompletionPort(h, file_complete, 0 ,1);
447 if (h != INVALID_HANDLE_VALUE)
450 if (close_after_write)
459 WriteFile(h, arg->
data, static_cast<DWORD>(strlen(message)), NULL, overlapped);
470 if (h != INVALID_HANDLE_VALUE)
477 int findFiles(
const char* directory,
const char* pattern, std::vector<std::string>& list,
bool full_path)
479 WIN32_FIND_DATA FindFileData;
482 std::string match = std::string(directory) +
"\\" + std::string(pattern);
484 hFind = FindFirstFile(match.c_str(), &FindFileData);
485 if (hFind == INVALID_HANDLE_VALUE)
491 file = std::string(directory) +
"\\" + std::string(FindFileData.cFileName);
495 file = std::string(FindFileData.cFileName);
497 list.push_back(file);
498 while(FindNextFile(hFind, &FindFileData) != 0)
502 file = std::string(directory) +
"\\" + std::string(FindFileData.cFileName);
506 file = std::string(FindFileData.cFileName);
508 list.push_back(file);
514 #include "Poco/StreamCopier.h"
515 #include "Poco/Path.h"
516 #include "Poco/URI.h"
517 #include "Poco/Exception.h"
519 #include "Poco/Net/HTTPClientSession.h"
520 #include "Poco/Net/HTTPRequest.h"
521 #include "Poco/Net/HTTPResponse.h"
522 #include "Poco/Net/HTMLForm.h"
524 #include "Poco/Net/SMTPClientSession.h"
525 #include "Poco/Net/MailMessage.h"
526 #include "Poco/Net/MailRecipient.h"
527 #include "Poco/Net/StringPartSource.h"
529 #include "Poco/StringTokenizer.h"
533 using Poco::Net::HTTPClientSession;
534 using Poco::Net::HTTPRequest;
535 using Poco::Net::HTTPResponse;
536 using Poco::Net::HTTPMessage;
537 using Poco::Net::HTMLForm;
538 using Poco::StreamCopier;
541 using Poco::Exception;
544 HTTPClientSession session(
"www.kapow.co.uk");
546 form.set(
"username",
"isissms");
547 form.set(
"password",
"camacdead");
548 form.set(
"mobile",phone);
549 form.set(
"sms",message);
550 session.setProxy(
"wwwcache.rl.ac.uk", 8080);
551 HTTPRequest request(HTTPRequest::HTTP_POST,
"/scripts/sendsms.php", HTTPMessage::HTTP_1_1);
552 std::ostringstream oss;
553 form.prepareSubmit(request);
555 std::ostream& os = session.sendRequest(request);
557 std::istream& rs = session.receiveResponse(res);
558 oss <<
"SMS status: " << res.getStatus() <<
" " << res.getReason() <<
" ";
559 StreamCopier::copyStream(rs, oss);
562 catch(Exception& exc)
571 using Poco::StringTokenizer;
572 status.
addInfoVa(
FAC_DAE,
"Sending SMS text to %s: %s", phone.c_str(), message.c_str());
573 StringTokenizer tokenizer(phone,
";,", StringTokenizer::TOK_IGNORE_EMPTY|StringTokenizer::TOK_TRIM);
574 for (StringTokenizer::Iterator it = tokenizer.begin(); it != tokenizer.end(); ++it)
582 int sendEmail(
const std::string& sender,
const std::string& recipient,
const std::string& subject,
const std::string& content,
DAEstatus& status)
584 using Poco::Net::MailMessage;
585 using Poco::Net::MailRecipient;
586 using Poco::Net::SMTPClientSession;
587 using Poco::Net::StringPartSource;
589 using Poco::Exception;
590 using Poco::StringTokenizer;
591 status.
addInfoVa(
FAC_DAE,
"Sending email to %s: %s", recipient.c_str(), subject.c_str());
595 message.setSender(sender);
596 StringTokenizer tokenizer(recipient,
";,", StringTokenizer::TOK_IGNORE_EMPTY|StringTokenizer::TOK_TRIM);
597 for (StringTokenizer::Iterator it = tokenizer.begin(); it != tokenizer.end(); ++it)
599 message.addRecipient(MailRecipient(MailRecipient::PRIMARY_RECIPIENT, *it));
601 if (tokenizer.count() == 0)
603 message.addRecipient(MailRecipient(MailRecipient::PRIMARY_RECIPIENT,
"freddie.akeroyd@stfc.ac.uk"));
607 message.addRecipient(MailRecipient(MailRecipient::BCC_RECIPIENT,
"freddie.akeroyd@stfc.ac.uk"));
609 message.setSubject(subject);
610 message.addContent(
new StringPartSource(content));
611 SMTPClientSession session(
"outbox.nd.rl.ac.uk");
613 session.sendMessage(message);
616 catch(Exception& exc)
632 ULARGE_INTEGER ularge1, ularge2;
633 ularge1.LowPart = start.dwLowDateTime;
634 ularge1.HighPart = start.dwHighDateTime;
635 ularge2.LowPart = finish.dwLowDateTime;
636 ularge2.HighPart= finish.dwHighDateTime;
637 if (ularge2.QuadPart > ularge1.QuadPart)
639 return ularge2.QuadPart - ularge1.QuadPart;
643 return -
static_cast<LONGLONG
>(ularge1.QuadPart - ularge2.QuadPart);
650 struct stat stat_buffer;
651 if (stat(filename.c_str(), &stat_buffer) == 0)
653 return stat_buffer.st_size;
663 template <
typename T>
664 void findConsecutive(
const std::vector<T>& vec, T invalid_val, std::vector<int>& indexes, std::vector<int>& sizes)
669 for(
int i=0; i<vec.size(); ++i)
671 if (vec[i] != invalid_val)
681 indexes.push_back(start);
684 while(j < vec.size())
686 if (vec[j] != invalid_val)
688 if ( (vec[j] - vec[j-1]) == 1 )
694 sizes.push_back(len);
695 indexes.push_back(j);
703 for(
int k=j+1; (k < vec.size()) && (start == -1); ++k)
705 if (vec[k] != invalid_val)
713 sizes.push_back(len);
714 indexes.push_back(start);
723 sizes.push_back(len);
725 for(
int i=0; i<indexes.size(); ++i)
727 for(j=0; j<sizes[i]; ++j)
729 if (vec[indexes[i]+j] == invalid_val)
731 throw std::exception(
"invalid val");
733 if ( (j != 0) && ((vec[indexes[i]+j] - vec[indexes[i]+j-1]) != 1) )
735 throw std::exception(
"not consec");
739 for(
int i=1; i<indexes.size(); ++i)
741 if ( (indexes[i-1] + sizes[i-1]) > indexes[i] )
743 throw std::exception(
"range overlap");
751 std::vector<int> error_locs;
752 for(i=0; i<nbuffer; ++i)
754 if (buffer1[i] != buffer2[i])
756 error_locs.push_back(i);
759 if (error_locs.size() > 0)
761 std::ostringstream oss;
762 std::vector<int> indexes, sizes;
765 for(i=0; i<indexes.size(); ++i)
767 oss <<
" " << error_locs[indexes[i]] <<
"-" << error_locs[indexes[i]+sizes[i]-1];
775 template void findConsecutive(
const std::vector<int>& vec,
int invalid_val, std::vector<int>& indexes, std::vector<int>& sizes);
783 void log(
const Poco::Message& msg)
785 OutputDebugString((msg.getText() +
"\n").c_str());
804 m_report_func = report_func;
805 m_report_arg = report_arg;
808 void log(
const Poco::Message& msg)
824 void log(
const Poco::Message& msg)
826 m_messages.push_back(msg);
833 Poco::Instantiator<DebuggerChannel, Poco::Channel> *debugger_channel_instantiator =
new Poco::Instantiator<DebuggerChannel, Poco::Channel>;
834 Poco::Instantiator<ICPFileChannel, Poco::Channel> *icp_file_channel_instantiator =
new Poco::Instantiator<ICPFileChannel, Poco::Channel>;
835 Poco::LoggingFactory::defaultFactory().registerChannelClass(
"DebuggerChannel", debugger_channel_instantiator);
836 Poco::LoggingFactory::defaultFactory().registerChannelClass(
"ICPFileChannel", icp_file_channel_instantiator);
848 std::string config_value = Poco::Util::Application::instance().config().getString(config_item,
"");
849 Poco::StringTokenizer toks(config_value,
";", Poco::StringTokenizer::TOK_IGNORE_EMPTY|Poco::StringTokenizer::TOK_TRIM);
850 std::copy(toks.begin(), toks.end(), back_inserter(string_list));
857 std::vector<std::string> string_list;
859 BOOST_FOREACH(
const std::string& s, string_list)
861 int_list.push_back(atoi(s.c_str()));
868 Poco::Util::Application&
the_app = Poco::Util::Application::instance();
872 app_dir = the_app.config().getString(
"application.dir");
874 catch(
const std::exception& ex)
876 the_app.logger().fatal(std::string(
"Cannot determine application.dir ") + ex.what());
877 std::cerr <<
"Cannot determine application.dir " << ex.what() << std::endl;
880 Poco::Path app_props(app_dir+
"/../../..", app_name+
".properties");
881 Poco::Path app_props_default(app_dir+
"/../../..", app_name+
".default.properties");
882 app_props.makeAbsolute();
883 app_props_default.makeAbsolute();
888 the_app.loadConfiguration(app_props_default.toString(), Poco::Util::Application::PRIO_DEFAULT);
890 catch(
const std::exception& ex)
892 the_app.logger().fatal(std::string(
"Cannot load ") + app_props_default.toString() + ex.what());
893 std::cerr <<
"Cannot load " << app_props_default.toString() << ex.what() << std::endl;
898 the_app.loadConfiguration(app_props.toString(), Poco::Util::Application::PRIO_APPLICATION);
900 catch(
const std::exception& ex)
902 the_app.logger().information(std::string(
"Cannot load ") + app_props.toString() + ex.what());
903 std::cerr <<
"Cannot load " << app_props.toString() << ex.what() << std::endl;
910 static int flushed_write(
const std::vector<std::string>& files,
const std::vector<const void*>& data,
const std::vector<int>& nbytes)
912 std::vector<FILE*> fp;
913 BOOST_FOREACH(
const std::string& filename, files)
915 fp.push_back(fopen(filename.c_str(),
"wbcN"));
917 for(
int i=0; i<files.size(); ++i)
922 if (std::fwrite(data[i], 1, nbytes[i], f) != nbytes[i])
925 throw std::runtime_error(
"cannot write data");
930 throw std::runtime_error(
"cannot open file");
933 for(
int i=0; i<files.size(); ++i)
936 if (std::fflush(f) != 0)
939 throw std::runtime_error(
"cannot flush data");
941 if (std::fclose(f) != 0)
943 throw std::runtime_error(
"cannot close data");
952 std::vector<std::string> file_v;
953 std::vector<const void*>data_v;
954 std::vector<int> nbytes_v;
955 file_v.push_back(file);
956 data_v.push_back(data);
957 nbytes_v.push_back(nbytes);
965 HANDLE h = CreateFile(file_name.c_str(), GENERIC_READ | GENERIC_WRITE, 0,
defaultNoInheritHandles(), CREATE_ALWAYS, 0, 0);
966 if (h == INVALID_HANDLE_VALUE)
968 return INVALID_HANDLE_VALUE;
971 li.QuadPart = file_size;
972 if (SetFilePointerEx(h, li, 0, FILE_BEGIN) == 0)
975 return INVALID_HANDLE_VALUE;
977 if (SetEndOfFile(h) == 0)
980 return INVALID_HANDLE_VALUE;
989 const int buffer_size = 512;
990 TCHAR szTemp[buffer_size];
993 if (GetLogicalDriveStrings(buffer_size-1, szTemp))
995 TCHAR szName[MAX_PATH];
996 TCHAR szDrive[3] = TEXT(
" :");
1006 if (QueryDosDevice(szDrive, szName, MAX_PATH))
1008 size_t uNameLen = _tcslen(szName);
1010 if (uNameLen < MAX_PATH)
1012 bFound = _tcsnicmp(pszFilename, szName, uNameLen) == 0;
1014 if (bFound && *(pszFilename + uNameLen) == _T(
'\\'))
1018 TCHAR szTempFile[MAX_PATH];
1019 _snprintf(szTempFile, MAX_PATH,
"%s%s", szDrive, pszFilename+uNameLen);
1020 strncpy(pszFilename, szTempFile, MAX_PATH);
1029 }
while (!bFound && *p);
1035 TCHAR pszFilename[MAX_PATH+1];
1036 int n = GetMappedFileName(GetCurrentProcess(), pMem, pszFilename, MAX_PATH);
1037 pszFilename[n] =
'\0';
1051 int64_t the_size = 0;
1052 WIN32_FILE_ATTRIBUTE_DATA file_attr;
1053 if ( GetFileAttributesEx(filename.c_str(), GetFileExInfoStandard, &file_attr) != 0 )
1055 the_size = (
static_cast<int64_t
>(file_attr.nFileSizeHigh) << 32) | file_attr.nFileSizeLow;
1064 if (h == INVALID_HANDLE_VALUE)
1074 MEMORYSTATUSEX statex;
1075 statex.dwLength =
sizeof(statex);
1076 if (GlobalMemoryStatusEx(&statex) != 0)
1078 status.
addInfoVa(
FAC_DAE,
"There is %8ld percent of memory in use.", statex.dwMemoryLoad);
1079 status.
addInfoVa(
FAC_DAE,
"There are %8I64d total Kbytes of physical memory.", statex.ullTotalPhys/1024);
1080 status.
addInfoVa(
FAC_DAE,
"There are %8I64d free Kbytes of physical memory.", statex.ullAvailPhys/1024);
1081 status.
addInfoVa(
FAC_DAE,
"There are %8I64d total Kbytes of paging file.", statex.ullTotalPageFile/1024);
1082 status.
addInfoVa(
FAC_DAE,
"There are %8I64d free Kbytes of paging file.", statex.ullAvailPageFile/1024);
1083 status.
addInfoVa(
FAC_DAE,
"There are %8I64d total Kbytes of virtual memory.", statex.ullTotalVirtual/1024);
1084 status.
addInfoVa(
FAC_DAE,
"There are %8I64d free Kbytes of virtual memory.", statex.ullAvailVirtual/1024);
1085 status.
addInfoVa(
FAC_DAE,
"There are %8I64d free Kbytes of extended memory", statex.ullAvailExtendedVirtual/1024);
1092 int ret = -1, nretry = 30;
1093 while( (--nretry > 0) && ((ret = std::remove(filename)) != 0) )
1095 Poco::Thread::sleep(1000);
1102 while(tm.count() > 0)
1104 Poco::Thread::sleep(poll_time_in_ms);
1112 ZeroMemory(
this,
sizeof(SECURITY_ATTRIBUTES));
1113 nLength =
sizeof(SECURITY_ATTRIBUTES);
1114 lpSecurityDescriptor = NULL;
1115 bInheritHandle = FALSE;
int md5sumFile(const char *filename, unsigned char *md5sum, DAEstatus &status)
LONGLONG diffFileTimes(const FILETIME &start, const FILETIME &finish)
finish - start, returned in 100ns units
void pollUntilTasksComplete(const Poco::TaskManager &tm, int poll_time_in_ms)
static ISISICPApp * the_app
std::string checksumAsString(md5checksum_t checksum)
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
int compareBuffers(const std::string &title, const isisU32_t *buffer1, const isisU32_t *buffer2, int nbuffer, DAEstatus &status)
bool compareChecksums(const unsigned char *md5sum1, const unsigned char *md5sum2)
void setICPChannelReporter(DAEreport_func_t *report_func, void *report_arg)
int DAEreport_func_t(const DAEstatus_message &mess, void *arg)
std::string fileNameFromMappedView(void *pMem)
void(* overlap_complete_func_t)(void *arg)
int add(DAEstatus &dstatus, bool clear)
static void * m_report_arg
void log(const Poco::Message &msg)
off_t file_size_bytes(const std::string &filename)
return size of a file in bytes
int updateChecksum(unsigned char *md5sum1, const unsigned char *md5sum2)
static const char * escape_sequence[]
void my_io_complete(void *arg)
SECURITY_ATTRIBUTES * defaultNoInheritHandles()
int setReportFunction(DAEreport_func_t *report_func, void *arg)
static const int escape_length[]
Poco::Mutex * atomic_mutex
double diffFileTimesInMilliSec(const FILETIME &start, const FILETIME &finish)
finish - start in milliseconds
void(__stdcall * MD5Final_t)(MD5_CTX *)
HANDLE createEmptyFile(const std::string &file_name, size_t file_size)
std::string convertWindows1252ToUTF8(const std::string &win_string)
std::list< Poco::Message > m_messages
void appendToFileAsync(HANDLE h, const char *message, bool close_after_write)
static void my_overlap(void *arg)
std::string escapeXML(const char *xml_str)
void(__stdcall * MD5Init_t)(MD5_CTX *)
double diffFileTimesInMilliSec(const FILETIME &start, const FILETIME &finish)
finish - start in milliseconds
int findFiles(const char *directory, const char *pattern, std::vector< std::string > &list, bool full_path)
static int sendSMSMain(const std::string &phone, const std::string &message, DAEstatus &status)
static my_SECURITY_ATTRIBUTES my_security_attributes
static void setReporter(DAEreport_func_t *report_func, void *report_arg)
HANDLE createAppendFile(const char *filename)
int loadAppConfig(const std::string &app_name)
load a config file from ../../.. i.e. from c:/labview modules/dae if we are in c:/labview modules/dae...
unsigned char md5checksum_t[16]
int sendEmail(const std::string &sender, const std::string &recipient, const std::string &subject, const std::string &content, DAEstatus &status)
double info(const char *title, std::ostream &os, bool add_nl=true)
void start(const char *title=NULL)
Poco::SingletonHolder< ICPClock > g_icp_clock
static const char * escape_replace[]
void AddEventSource(PCTSTR pszName, PCTSTR pszMessageFile, DWORD dwCategoryCount)
static void deviceNameToDriveLetter(TCHAR *pszFilename)
int removeWithRetry(const char *filename)
return 0 on success, else error
void getConfigIntList(std::vector< int > &int_list, const std::string &config_item)
read a ; separated list of items from a properties file and return the items as a vector<int> ...
void(__stdcall * MD5Update_t)(MD5_CTX *, const unsigned char *, unsigned int)
void MD5Init(struct MD5Context *ctx, int brokenEndian)
int md5sumString(const void *buffer, int len, unsigned char *md5sum, DAEstatus &status)
int createEmptyFileAndClose(const std::string &file_name, size_t file_size)
timings_t m_process_times
void log(const Poco::Message &msg)
void reportImmediately(bool value)
void getConfigStringList(std::vector< std::string > &string_list, const std::string &config_item)
read a ; separated list of items from a properties file and return the items as a vector<string> ...
static DAEreport_func_t * m_report_func
std::string unescapeXML(const char *xml_str)
void registerExtraLoggerChannels()
int addInfo(int facility, const std::string &text)
static Poco::Mutex atomic_mutex_impl
int parseSpectraRange(const std::string &spec_range, int &spec_from, int &spec_to)
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
overlap_complete_func_t func
int sendSMS(const std::string &phone, const std::string &message, DAEstatus &status)
int addInfoVa(int facility, const char *format,...)
MyOverlapped(overlap_complete_func_t func_, void *arg_)
void findConsecutive(const std::vector< T > &vec, T invalid_val, std::vector< int > &indexes, std::vector< int > &sizes)
return an array of indices containing the start points of consecutive sequences of numbers ...
void log(const Poco::Message &msg)
static int flushed_write(const std::vector< std::string > &files, const std::vector< const void * > &data, const std::vector< int > &nbytes)
void printComputerMemoryStats(DAEstatus &status)
std::string convertLatin1ToUTF8(const std::string &latin_string)
convert ISO Latin-1 (8859-1) to UTF-8
my_overlap_t(HANDLE h_, const char *data_)
static HANDLE file_complete
int64_t fileSizeBytes(const std::string &filename)