~ubuntu-branches/ubuntu/saucy/lordsawar/saucy

« back to all changes in this revision

Viewing changes to src/portlist.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese
  • Date: 2008-12-20 13:52:12 UTC
  • mfrom: (1.1.6 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20081220135212-noeb2w3y98ebo7o9
Tags: 0.1.4-1
[ Barry deFreese ]
* New upstream release.
* Move 0.0.8-2.1 changelog entry to correct point in changelog.
* Make lordsawar-data suggest lordsawar.
* Update my e-mail address.
* Add build-depends on intltool, uuid-dev, and libboost-dev.
* Don't install locales since there are no translations currently.
* Add simple man page for new lordsawar-pbm binary.
* Drop gcc4.3 patches as they have been fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "portlist.h"
21
21
#include "xmlhelper.h"
22
22
 
 
23
std::string Portlist::d_tag = "portlist";
 
24
 
23
25
//#define debug(x) {cerr<<__FILE__<<": "<<__LINE__<<": "<<x<<endl<<flush;}
24
26
#define debug(x)
25
27
 
56
58
 
57
59
Portlist::Portlist(XML_Helper* helper)
58
60
{
59
 
    helper->registerTag("port", sigc::mem_fun(this, &Portlist::load));
 
61
    helper->registerTag(Port::d_tag, sigc::mem_fun(this, &Portlist::load));
60
62
}
61
63
 
62
64
bool Portlist::save(XML_Helper* helper) const
63
65
{
64
66
    bool retval = true;
65
67
 
66
 
    retval &= helper->openTag("portlist");
 
68
    retval &= helper->openTag(Portlist::d_tag);
67
69
 
68
70
    for (const_iterator it = begin(); it != end(); it++)
69
 
        retval &= (*it).save(helper);
 
71
        retval &= (*it)->save(helper);
70
72
    
71
73
    retval &= helper->closeTag();
72
74
 
75
77
 
76
78
bool Portlist::load(std::string tag, XML_Helper* helper)
77
79
{
78
 
    if (tag != "port")
 
80
    if (tag != Port::d_tag)
79
81
    //what has happened?
80
82
        return false;
81
83
    
82
 
    Port s(helper);
83
 
    push_back(s);
 
84
    push_back(new Port(helper));
84
85
 
85
86
    return true;
86
87
}