Switch to unified view

a/src/utils/conftree.h b/src/utils/conftree.h
...
...
64
     */
64
     */
65
    ConfSimple(const char *fname, int readonly = 0, bool tildexp = false);
65
    ConfSimple(const char *fname, int readonly = 0, bool tildexp = false);
66
66
67
    /**
67
    /**
68
     * Build the object by reading content from a string
68
     * Build the object by reading content from a string
69
     * @param data points to the data to parse
69
     * @param data points to the data to parse. 
70
     * @param readonly if true open readonly, else rw
70
     * @param readonly if true open readonly, else rw
71
     * @param tildexp  try tilde (home dir) expansion for subsection names
71
     * @param tildexp  try tilde (home dir) expansion for subsection names
72
     */
72
     */
73
    ConfSimple(string *data, int readonly = 0, bool tildexp = false);
73
    ConfSimple(string *data, int readonly = 0, bool tildexp = false);
74
74
...
...
125
     */
125
     */
126
    ConfSimple(const ConfSimple &rhs) : data(0) {
126
    ConfSimple(const ConfSimple &rhs) : data(0) {
127
    if ((status = rhs.status) == STATUS_ERROR)
127
    if ((status = rhs.status) == STATUS_ERROR)
128
        return;
128
        return;
129
    filename = rhs.filename;
129
    filename = rhs.filename;
130
  if (rhs.data) {
130
  // Note: we just share the pointer, this doesnt belong to us
131
      data = new string(*(rhs.data));
131
  data = rhs.data;
132
  }
133
    submaps = rhs.submaps;
132
    submaps = rhs.submaps;
134
    }
133
    }
135
134
136
    /**
135
    /**
137
     * Assignement. This is expensive
136
     * Assignement. This is expensive
138
     */
137
     */
139
    ConfSimple& operator=(const ConfSimple &rhs) {
138
    ConfSimple& operator=(const ConfSimple &rhs) {
140
    if (this != &rhs && (status = rhs.status) != STATUS_ERROR) {
139
    if (this != &rhs && (status = rhs.status) != STATUS_ERROR) {
141
      delete data;
142
      data = 0;
143
        filename = rhs.filename;
140
        filename = rhs.filename;
144
      if (rhs.data) {
141
      // Note: we don't own data. Just share the pointer
145
      data = new string(*(rhs.data));
142
      data = rhs.data;
146
      }
147
        submaps = rhs.submaps;
143
        submaps = rhs.submaps;
148
    }
144
    }
149
    return *this;
145
    return *this;
150
    }
146
    }
151
147