普通文本  |  51行  |  1.45 KB

// Copyright 2012 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "polo/pairing/message/pairingrequestackmessage.h"

#include <sstream>

namespace polo {
namespace pairing {
namespace message {

PairingRequestAckMessage::PairingRequestAckMessage()
    : PoloMessage(PoloMessage::kPairingRequestAck),
      server_name_("") {
}

PairingRequestAckMessage::PairingRequestAckMessage(
    const std::string& server_name)
    : PoloMessage(PoloMessage::kPairingRequestAck),
      server_name_(server_name) {
}

std::string PairingRequestAckMessage::server_name() const {
  return server_name_;
}

bool PairingRequestAckMessage::has_server_name() const {
  return server_name_.length() > 0;
}

std::string PairingRequestAckMessage::ToString() const {
  std::ostringstream ss;
  ss << "[PairingRequestAckMessage server_name=" << server_name_ << "]";
  return ss.str();
}

}  // namespace message
}  // namespace pairing
}  // namespace polo