1// Copyright 2013 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.
4
5#include "chrome/common/local_discovery/service_discovery_client.h"
6
7namespace local_discovery {
8
9ServiceDescription::ServiceDescription() {
10}
11
12ServiceDescription::~ServiceDescription() {
13}
14
15std::string ServiceDescription::instance_name() const {
16  // TODO(noamsml): Once we have escaping working, get this to
17  // parse escaped domains.
18  size_t first_period = service_name.find_first_of('.');
19  return service_name.substr(0, first_period);
20}
21
22std::string ServiceDescription::service_type() const {
23  // TODO(noamsml): Once we have escaping working, get this to
24  // parse escaped domains.
25  size_t first_period = service_name.find_first_of('.');
26  if (first_period == std::string::npos)
27    return "";
28  return service_name.substr(first_period+1);
29}
30
31}  // namespace local_discovery
32