pairingrequestackmessage.cc revision 7c9978567a202d6aa98beac5da5e1b3b34792862
1// Copyright 2012 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#include "polo/pairing/message/pairingrequestackmessage.h"
16
17#include <sstream>
18
19namespace polo {
20namespace pairing {
21namespace message {
22
23PairingRequestAckMessage::PairingRequestAckMessage()
24    : PoloMessage(PoloMessage::kPairingRequestAck),
25      server_name_("") {
26}
27
28PairingRequestAckMessage::PairingRequestAckMessage(
29    const std::string& server_name)
30    : PoloMessage(PoloMessage::kPairingRequestAck),
31      server_name_(server_name) {
32}
33
34std::string PairingRequestAckMessage::server_name() const {
35  return server_name_;
36}
37
38bool PairingRequestAckMessage::has_server_name() const {
39  return server_name_.length() > 0;
40}
41
42std::string PairingRequestAckMessage::ToString() const {
43  std::ostringstream ss;
44  ss << "[PairingRequestAckMessage server_name=" << server_name_ << "]";
45  return ss.str();
46}
47
48}  // namespace message
49}  // namespace pairing
50}  // namespace polo
51