~ubuntu-branches/ubuntu/trusty/aria2/trusty

« back to all changes in this revision

Viewing changes to src/Option.h

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry
  • Date: 2013-12-16 18:41:03 UTC
  • mfrom: (2.5.21 sid)
  • Revision ID: package-import@ubuntu.com-20131216184103-xzah3019zwut429g
Tags: 1.18.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include <vector>
42
42
#include <memory>
43
43
 
 
44
#include "prefs.h"
 
45
 
44
46
namespace aria2 {
45
47
 
46
 
struct Pref;
47
 
 
48
48
class Option {
49
49
private:
50
50
  std::vector<std::string> table_;
56
56
  Option(const Option& option);
57
57
  Option& operator=(const Option& option);
58
58
 
59
 
  void put(const Pref* pref, const std::string& value);
 
59
  void put(PrefPtr pref, const std::string& value);
60
60
  // Returns true if name is defined. Otherwise returns false.  Note
61
61
  // that even if the value is a empty string, this method returns
62
62
  // true.  If option is not defined in this object and parent_ is not
63
63
  // NULL, lookup parent_ to check |pref| is defined.
64
 
  bool defined(const Pref* pref) const;
 
64
  bool defined(PrefPtr pref) const;
65
65
  // Just like defined(), but this function does not lookup parent_.
66
 
  bool definedLocal(const Pref* pref) const;
 
66
  bool definedLocal(PrefPtr pref) const;
67
67
  // Returns true if name is not defined or the value is a empty string.
68
68
  // Otherwise returns false.
69
 
  bool blank(const Pref* pref) const;
 
69
  bool blank(PrefPtr pref) const;
70
70
  // Returns option value for |pref|. If the |pref| is not defined in
71
71
  // this object, parent_ is looked up.
72
 
  const std::string& get(const Pref* pref) const;
73
 
  int32_t getAsInt(const Pref* pref) const;
74
 
  int64_t getAsLLInt(const Pref* pref) const;
75
 
  bool getAsBool(const Pref* pref) const;
76
 
  double getAsDouble(const Pref* pref) const;
 
72
  const std::string& get(PrefPtr pref) const;
 
73
  int32_t getAsInt(PrefPtr pref) const;
 
74
  int64_t getAsLLInt(PrefPtr pref) const;
 
75
  bool getAsBool(PrefPtr pref) const;
 
76
  double getAsDouble(PrefPtr pref) const;
77
77
  // Removes |pref| from this object. This function does not modify
78
78
  // parent_.
79
 
  void remove(const Pref* pref);
 
79
  void remove(PrefPtr pref);
80
80
  // Removes all option values from this object. This function does
81
81
  // not modify parent_.
82
82
  void clear();