~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/src/config/yamlnode.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
3
3
 *  Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
4
4
 *
5
5
 *  This program is free software; you can redistribute it and/or modify
52
52
 
53
53
void YamlDocument::deleteChildNodes()
54
54
{
55
 
    for (Sequence::iterator it = doc_.begin(); it != doc_.end(); ++it) {
56
 
        YamlNode *yamlNode = static_cast<YamlNode *>(*it);
 
55
    for (auto &it : doc_) {
 
56
        YamlNode *yamlNode = static_cast<YamlNode *>(it);
57
57
 
58
58
        yamlNode->deleteChildNodes();
59
59
        delete yamlNode;
109
109
    *i = std::atoi(node->getValue().c_str());
110
110
}
111
111
 
 
112
void MappingNode::getValue(const std::string &key, double *d) const
 
113
{
 
114
    ScalarNode *node = static_cast<ScalarNode*>(getValue(key));
 
115
    if (!node) {
 
116
        ERROR("node %s not found", key.c_str());
 
117
        return;
 
118
    }
 
119
 
 
120
    *d = std::atof(node->getValue().c_str());
 
121
}
 
122
 
112
123
void MappingNode::getValue(const std::string &key, std::string *v) const
113
124
{
114
125
    ScalarNode *node = static_cast<ScalarNode*>(getValue(key));
124
135
 
125
136
void MappingNode::deleteChildNodes()
126
137
{
127
 
    for (YamlNodeMap::iterator it = map_.begin(); it != map_.end(); ++it) {
128
 
        YamlNode *yamlNode = static_cast<YamlNode *>(it->second);
 
138
    for (auto &it : map_) {
 
139
        YamlNode *yamlNode = static_cast<YamlNode *>(it.second);
129
140
 
130
141
        if (!yamlNode)
131
142
            continue;
144
155
 
145
156
void SequenceNode::deleteChildNodes()
146
157
{
147
 
    for (Sequence::iterator it = seq_.begin(); it != seq_.end(); ++it) {
148
 
        YamlNode *yamlNode = static_cast<YamlNode *>(*it);
 
158
    for (auto &it : seq_) {
 
159
        YamlNode *yamlNode = static_cast<YamlNode *>(it);
149
160
 
150
161
        yamlNode->deleteChildNodes();
151
162
        delete yamlNode;