• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
7 namespace local_discovery {
8 
ServiceDescription()9 ServiceDescription::ServiceDescription() {
10 }
11 
~ServiceDescription()12 ServiceDescription::~ServiceDescription() {
13 }
14 
instance_name() const15 std::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 
service_type() const22 std::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