summaryrefslogtreecommitdiff
path: root/indra/newview/lllogchat.h
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-09-03 17:41:39 +0100
committerAimee Linden <aimee@lindenlab.com>2010-09-03 17:41:39 +0100
commitffae589843c2977ae7f70de78d84c936e2a91291 (patch)
tree497660a88fe55382639dea1b2f3499241127470d /indra/newview/lllogchat.h
parent63f2ddf377fa0fc6a666cdc1001289335d86258b (diff)
parent25c29d59cf658acec5901c6f06775add10cf0bfd (diff)
Post-convert merge by convert_monolith.py from /Users/Aimee/Documents/Work/Linden-Lab/Development/viewer/convert/viewer-identity-evolution
Diffstat (limited to 'indra/newview/lllogchat.h')
-rw-r--r--indra/newview/lllogchat.h49
1 files changed, 15 insertions, 34 deletions
diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h
index e544bb2d45..8b1cc3484f 100644
--- a/indra/newview/lllogchat.h
+++ b/indra/newview/lllogchat.h
@@ -24,10 +24,11 @@
* $/LicenseInfo$
*/
-
#ifndef LL_LLLOGCHAT_H
#define LL_LLLOGCHAT_H
+class LLChat;
+
class LLLogChat
{
public:
@@ -40,49 +41,22 @@ public:
};
static std::string timestamp(bool withdate = false);
static std::string makeLogFileName(std::string(filename));
+
+ // Log a single line item to the appropriate chat file
+ static void saveHistory(const std::string& filename, const LLChat& chat);
+
+ // Prefer the above version - it saves more metadata about the item
static void saveHistory(const std::string& filename,
const std::string& from,
const LLUUID& from_id,
const std::string& line);
- /** @deprecated @see loadAllHistory() */
- static void loadHistory(const std::string& filename,
- void (*callback)(ELogLineType, const LLSD&, void*),
- void* userdata);
-
static void loadAllHistory(const std::string& file_name, std::list<LLSD>& messages);
private:
static std::string cleanFileName(std::string filename);
};
/**
- * Formatter for the plain text chat log files
- */
-class LLChatLogFormatter
-{
-public:
- LLChatLogFormatter(const LLSD& im) : mIM(im) {}
- virtual ~LLChatLogFormatter() {};
-
- friend std::ostream& operator<<(std::ostream& str, const LLChatLogFormatter& formatter)
- {
- formatter.format(formatter.mIM, str);
- return str;
- }
-
-protected:
-
- /**
- * Format an instant message to a stream
- * Timestamps and sender names are required
- * New lines of multilined messages are prepended with a space
- */
- void format(const LLSD& im, std::ostream& ostr) const;
-
- LLSD mIM;
-};
-
-/**
* Parser for the plain text chat log files
*/
class LLChatLogParser
@@ -100,11 +74,18 @@ public:
*
* @return false if failed to parse mandatory data - message text
*/
- static bool parse(std::string& raw, LLSD& im);
+ static bool parse(const std::string& raw, LLSD& im);
protected:
LLChatLogParser();
virtual ~LLChatLogParser() {};
};
+// LLSD map lookup constants
+extern const std::string IM_TIME; //("time");
+extern const std::string IM_TEXT; //("message");
+extern const std::string IM_FROM; //("from");
+extern const std::string IM_FROM_ID; //("from_id");
+extern const std::string IM_SOURCE_TYPE; //("source_type");
+
#endif