1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_SIGNALING_SERVER_LOG_ENTRY_H_
6 #define REMOTING_SIGNALING_SERVER_LOG_ENTRY_H_
11 #include "base/memory/scoped_ptr.h"
19 // Utility class for building log entries to send to the remoting bot. This is
20 // a wrapper around a key/value map and is copyable so it can be used in STL
22 class ServerLogEntry
{
24 // The mode of a connection.
33 // Sets an arbitrary key/value entry.
34 void Set(const std::string
& key
, const std::string
& value
);
36 // Adds a field describing the CPU type of the platform.
39 // Adds a field describing the mode of a connection to this log entry.
40 void AddModeField(Mode mode
);
42 // Adds a field describing the role (client/host).
43 void AddRoleField(const char* role
);
45 // Adds a field describing the type of log entry.
46 void AddEventNameField(const char* name
);
48 // Constructs a log stanza. The caller should add one or more log entry
49 // stanzas as children of this stanza, before sending the log stanza to
51 static scoped_ptr
<buzz::XmlElement
> MakeStanza();
53 // Converts this object to an XML stanza.
54 scoped_ptr
<buzz::XmlElement
> ToStanza() const;
57 typedef std::map
<std::string
, std::string
> ValuesMap
;
59 ValuesMap values_map_
;
62 } // namespace remoting
64 #endif // REMOTING_SIGNALING_SERVER_LOG_ENTRY_H_