---------------------------------------------------------------------------
| 6 | #include "file.h" |
| 7 | //--------------------------------------------------------------------------- |
| 8 | class TSyslogMessage |
| 9 | { |
| 10 | public: |
| 11 | String SourceAddr; // IP |
| 12 | int PRI; // -1: PRI not exist in message |
| 13 | String Facility; |
| 14 | String Priority; // also called Severity |
| 15 | String DateStr; |
| 16 | String HostName; |
| 17 | String Tag; |
| 18 | String Msg; |
| 19 | |
| 20 | public: |
| 21 | TSyslogMessage(); |
| 22 | void Clear(); |
| 23 | |
| 24 | // Read message from string p (string must be in syslog RFC 3164 format), |
| 25 | // p must be null terminated |
| 26 | bool FromStringSyslogd(char * p, int size, sockaddr_in * from_addr); |
| 27 | |
| 28 | // Format message to string (saving to file) |
| 29 | AnsiString ToString(void); |
| 30 | // Read message from string p[len] |
| 31 | void FromString(char * p, int len); |
| 32 | |
| 33 | // Convert message to text string in clipboard format |
| 34 | String ToStringClipboard(void); |
| 35 | |
| 36 | // Convert message to text string in custom format |
| 37 | // fmt may contains: {time} {ip} {host} {facility} {priority} {tag} {message} |
| 38 | String Format(String fmt); |
| 39 | |
| 40 | // Write to file |
| 41 | //bool SaveToFile(const String & file); |
| 42 | //bool SaveToFile(TFile & out); |
| 43 | //bool SaveToFile(const String & file, TFile & out); |
| 44 | }; |
| 45 | //--------------------------------------------------------------------------- |
| 46 | bool IsValidSyslogDate(const char * p); |
| 47 | //--------------------------------------------------------------------------- |
nothing calls this directly
no outgoing calls
no test coverage detected