~sharpie/geos/3.3.2

« back to all changes in this revision

Viewing changes to source/geomgraph/Depth.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2006-11-06 21:35:52 UTC
  • mfrom: (3.1.3 feisty)
  • Revision ID: james.westby@ubuntu.com-20061106213552-m03o92ggj1na737b
Tags: 2.2.3-3
debian/control: move doxygen from build-depends-indep to build-depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**********************************************************************
2
 
 * $Id: Depth.cpp,v 1.2 2004/07/02 13:28:26 strk Exp $
 
2
 * $Id: Depth.cpp,v 1.2.2.1 2005/05/23 18:41:51 strk Exp $
3
3
 *
4
4
 * GEOS - Geometry Engine Open Source
5
5
 * http://geos.refractions.net
13
13
 *
14
14
 **********************************************************************
15
15
 * $Log: Depth.cpp,v $
 
16
 * Revision 1.2.2.1  2005/05/23 18:41:51  strk
 
17
 * Replaced sprintf uses with ostringstream
 
18
 *
16
19
 * Revision 1.2  2004/07/02 13:28:26  strk
17
20
 * Fixed all #include lines to reflect headers layout change.
18
21
 * Added client application build tips in README.
28
31
 **********************************************************************/
29
32
 
30
33
 
 
34
#include <sstream>
31
35
#include <geos/geomgraph.h>
32
 
#include <stdio.h>
33
36
#define DEPTHNULL -1
34
37
 
35
38
namespace geos {
137
140
}
138
141
 
139
142
string Depth::toString() {
140
 
        string result("");
141
 
        char buffer[255];
142
 
        sprintf(buffer,"A: %i,%i B:%i,%i]",depth[0][1],depth[0][2],depth[1][1],depth[1][2]);
143
 
        result.append(buffer);
144
 
        result.append("");
145
 
        return result;
 
143
        ostringstream s;
 
144
        s<<"A:"<<depth[0][1]<<","<<depth[0][2]<<" ";
 
145
        s<<"B:"<<depth[1][1]<<","<<depth[1][2]<<"]";
 
146
        return s.str();
146
147
}
147
148
 
148
149