~ubuntu-branches/ubuntu/precise/ceph/precise-proposed

« back to all changes in this revision

Viewing changes to src/common/str_list.cc

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2011-04-25 10:09:05 UTC
  • mfrom: (1.1.3 upstream) (0.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110425100905-exm7dfvi2v5ick02
Tags: 0.27-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 
2
// vim: ts=8 sw=2 smarttab
 
3
/*
 
4
 * Ceph - scalable distributed file system
 
5
 *
 
6
 * Copyright (C) 2009-2010 Dreamhost
 
7
 *
 
8
 * This is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Lesser General Public
 
10
 * License version 2.1, as published by the Free Software
 
11
 * Foundation.  See file COPYING.
 
12
 *
 
13
 */
 
14
 
1
15
#include <iostream>
2
16
#include <list>
3
17
#include <set>
4
18
 
5
 
using namespace std;
 
19
using std::string;
6
20
 
7
 
static bool get_next_token(string s, size_t& pos, string& token)
 
21
static bool get_next_token(const std::string &s, size_t& pos, string& token)
8
22
{
9
23
  int start = s.find_first_not_of(" \t", pos);
10
24
  int end;
11
25
 
12
26
  if (start < 0)
13
 
    return false; 
 
27
    return false;
14
28
 
15
29
  if (s[start]== ',')
16
30
    end = start + 1;
25
39
  return true;
26
40
}
27
41
 
28
 
bool get_str_list(string& str, list<string>& str_list)
 
42
bool get_str_list(const std::string& str, std::list<string>& str_list)
29
43
{
30
44
  size_t pos = 0;
31
45
  string token;
43
57
  return true;
44
58
}
45
59
 
46
 
 
47
 
bool get_str_set(string& str, set<string>& str_set)
 
60
bool get_str_set(const std::string& str, std::set<std::string>& str_set)
48
61
{
49
62
  size_t pos = 0;
50
63
  string token;
61
74
 
62
75
  return true;
63
76
}
64
 
 
65