76 const size_t p = name.find_first_of(
'/');
78 throw logic_error(
"Could not determine server name");
80 server = name.substr(0, p);
83 if (desc.find_first_of(
'\n')!=string::npos)
84 throw logic_error(
"Description for "+name+
" contains '\\n'");
88 fService =
new DimService((server+
"/SERVICE_DESC").c_str(), const_cast<char*>(
""));
90 server +
"/SERVICE_DESC" 91 "=Descriptions of services or commands and there arguments" 92 "|Description[string]:For a detailed " 93 "explanation of the descriptive string see the class reference " 94 "of DimDescriptionService.\n" +
95 server +
"/CLIENT_LIST" 96 "=Native Dim service: A list of all connected clients\n" +
97 server +
"/VERSION_NUMBER" 98 "=Native Dim service: Version number of Dim in use" 99 "|DimVer[int]:Version*100+Release (e.g. V19r17 = 1917)\n" +
101 "=This is a native Dim command: Exit program" 102 "remotely. FACT++ programs use the given number as return code." 103 "|Rc[int]:Return code, under normal circumstances this should be 0 or 1 (42 will call exit() directly, 0x42 will call abort() directly.\n" +
104 server +
"/SERVICE_LIST" 105 "=Native Dim service: List of services, commands and formats" 106 "|ServiceList[string]:For details see the Dim manual.\n";
112 fDescription = name +
'=' + desc;
114 if (
fData.find(fDescription+
'\n')!=std::string::npos)
117 fData += fDescription +
'\n';
120 fService->setTimestamp(t.
Time_t(), t.
ms());
121 fService->setData(const_cast<char*>(
fData.c_str()));
122 fService->updateService();
134 const size_t pos =
fData.find(fDescription+
'\n');
135 if (pos!=std::string::npos)
136 fData.replace(pos, fDescription.size()+1,
"");
158 return updateService();
163 return Update(
Time());
168 return Update(data.data());
Adds some functionality to boost::posix_time::ptime for our needs.
static DimService * fService
Counter to count the number of instatiations.
DimDescriptionService(const std::string &name, const std::string &format)
Local storage for the applied description.
virtual ~DimDescriptionService()
static std::set< std::string > fServices
static std::string fData
Pointer to the DimService distributing the desscriptions.