Home | History | Annotate | Download | only in message
      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 
     19 namespace polo {
     20 namespace pairing {
     21 namespace message {
     22 
     23 PairingRequestAckMessage::PairingRequestAckMessage()
     24     : PoloMessage(PoloMessage::kPairingRequestAck),
     25       server_name_("") {
     26 }
     27 
     28 PairingRequestAckMessage::PairingRequestAckMessage(
     29     const std::string& server_name)
     30     : PoloMessage(PoloMessage::kPairingRequestAck),
     31       server_name_(server_name) {
     32 }
     33 
     34 std::string PairingRequestAckMessage::server_name() const {
     35   return server_name_;
     36 }
     37 
     38 bool PairingRequestAckMessage::has_server_name() const {
     39   return server_name_.length() > 0;
     40 }
     41 
     42 std::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