source: subversion/libs/libosm/Object.cpp @ 2327

Revision 2327, 541 bytes checked in by jonb, 7 years ago (diff)

Fix lat/lon precision, generate self-closing tags, indent output, error check parsing

Line 
1#include "Object.h"
2#include <iostream>
3
4using std::endl;
5
6namespace OSM
7{
8
9std::vector<std::string> Object::getTags()
10{
11        std::vector<std::string> t;
12
13        for(std::map<std::string,std::string>::iterator i=tags.begin(); 
14                        i!=tags.end(); i++)
15        {
16                t.push_back(i->first);
17        }
18
19        return t;
20}
21
22// 260107 converted ' to "
23void Object::tagsToXML(std::ostream &strm)
24{
25        for(std::map<std::string,std::string>::iterator i=tags.begin(); 
26                        i!=tags.end(); i++)
27        {
28                strm << "    <tag k=\"" << i->first << "\" v=\"" << i->second << "\"/>" << endl;
29        }
30}
31
32}
Note: See TracBrowser for help on using the repository browser.