This file is indexed.

/usr/include/geos/io/WKBWriter.h is in libgeos-dev 3.2.2-3ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/**********************************************************************
 * $Id: WKBWriter.h 2579 2009-06-15 14:03:52Z strk $
 *
 * GEOS - Geometry Engine Open Source
 * http://geos.refractions.net
 *
 * Copyright (C) 2005-2006 Refractions Research Inc.
 * Copyright (C) 2001-2002 Vivid Solutions Inc.
 *
 * This is free software; you can redistribute and/or modify it under
 * the terms of the GNU Lesser General Public Licence as published
 * by the Free Software Foundation. 
 * See the COPYING file for more information.
 *
 **********************************************************************
 *
 * Last port: io/WKBWriter.java rev. 1.1 (JTS-1.7)
 *
 **********************************************************************/

#ifndef GEOS_IO_WKBWRITER_H
#define GEOS_IO_WKBWRITER_H

#include <geos/export.h>

#include <geos/platform.h> // for getMachineByteOrder
#include <iosfwd>

// Forward declarations
namespace geos {
	namespace geom {

		class CoordinateSequence;
		class Geometry;
		class GeometryCollection;
		class Point;
		class LineString;
		class LinearRing;
		class Polygon;
		class MultiPoint;
		class MultiLineString;
		class MultiPolygon;
		class PrecisionModel;

	} // namespace geom
} // namespace geos

namespace geos {
namespace io {

/**
 *
 * \class WKBWriter io.h geos.h
 *
 * \brief Writes a Geometry into Well-Known Binary format.
 *
 * The WKB format is specified in the OGC Simple Features for SQL specification.
 * This implementation supports the extended WKB standard for representing
 * 3-dimensional coordinates.  The presence of 3D coordinates is signified
 * by setting the high bit of the wkbType word.
 *
 * Empty Points cannot be represented in WKB; an
 * IllegalArgumentException will be thrown if one is
 * written. The WKB specification does not support representing LinearRing
 * they will be written as LineString
 * 
 * This class is designed to support reuse of a single instance to read multiple
 * geometries. This class is not thread-safe; each thread should create its own
 * instance.
 *
 * @see WKBReader
 */
class GEOS_DLL WKBWriter {

public:
	/*
	 * \brief
	 * Initializes writer with target coordinate dimention, endianness flag
     * and SRID value.
	 * <code>WKBWriter</code>.
     */
	WKBWriter(int dims=2, int bo=getMachineByteOrder(), bool includeSRID=false);

    /*
     * \brief
     * Destructor.
     */
    virtual ~WKBWriter();

	/*
	 * \brief
	 * Returns the output dimension used by the
	 * <code>WKBWriter</code>.
	 */
	virtual int getOutputDimension() const { return outputDimension; }

	/*
	 * Sets the output dimension used by the
	 * <code>WKBWriter</code>.
	 */
	virtual void setOutputDimension(int newOutputDimension) { outputDimension=newOutputDimension; }
	
	/*
	 * \brief
	 * Returns the byte order used by the
	 * <code>WKBWriter</code>.
	 */
	virtual int getByteOrder() const { return byteOrder; }

	/*
	 * Sets the byte order used by the
	 * <code>WKBWriter</code>.
	 */
	virtual void setByteOrder(int newByteOrder) { byteOrder=newByteOrder; }

	/*
	 * \brief
	 * Returns whether SRID values are output by the
	 * <code>WKBWriter</code>.
	 */
	virtual int getIncludeSRID() const { return includeSRID; }

	/*
	 * Sets whether SRID values should be output by the
	 * <code>WKBWriter</code>.
	 */
    virtual void setIncludeSRID(int newIncludeSRID) { includeSRID = (0 == newIncludeSRID ? false : true); }

	/**
	 * \brief Write a Geometry to an ostream.
	 *
	 * @param g the geometry to write
	 * @param os the output stream
	 * @throws IOException
	 */
	void write(const geom::Geometry &g, std::ostream &os);
		// throws IOException, ParseException

	/**
	 * \brief Write a Geometry to an ostream in binary hex format.
	 *
	 * @param g the geometry to write
	 * @param os the output stream
	 * @throws IOException
	 */
	void writeHEX(const geom::Geometry &g, std::ostream &os);
		// throws IOException, ParseException

private:

	int outputDimension;

	int byteOrder;
	
	bool includeSRID;

	std::ostream *outStream;

	unsigned char buf[8];

	void writePoint(const geom::Point &p);
		// throws IOException

	void writeLineString(const geom::LineString &ls);
		// throws IOException

	void writePolygon(const geom::Polygon &p);
		// throws IOException

	void writeGeometryCollection(const geom::GeometryCollection &c, int wkbtype);
		// throws IOException, ParseException

	void writeCoordinateSequence(const geom::CoordinateSequence &cs, bool sized);
		// throws IOException

	void writeCoordinate(const geom::CoordinateSequence &cs, int idx, bool is3d);
		// throws IOException

	void writeGeometryType(int geometryType, int SRID);
		// throws IOException

	void writeSRID(int SRID);
		// throws IOException

	void writeByteOrder();
		// throws IOException

	void writeInt(int intValue);
		// throws IOException

};

} // namespace io
} // namespace geos

#endif // #ifndef GEOS_IO_WKBWRITER_H

/**********************************************************************
 * $Log$
 * Revision 1.2  2006/03/28 11:26:13  strk
 * ByteOrderDataInStream inlines moved to .inl file, updated
 * implementation files includes.
 *
 * Revision 1.1  2006/03/20 18:18:14  strk
 * io.h header split
 *
 **********************************************************************/