10 #ifndef AUTOLAYER_H_UOFARIZONAVISION
11 #define AUTOLAYER_H_UOFARIZONAVISION
31 int set_name(
const std::string& name )
37 strcpy( my_layer.
filename, name.c_str() );
38 return kjb_c::NO_ERROR;
41 void set_numTracks(
int );
79 int write(
const std::string& filename )
81 KJB(
ETX( set_name( filename ) ) );
83 return kjb_c::NO_ERROR;
#define ETX(a)
Definition: l_exception.h:67
Contains definitions of basic TopoFusion data structures.
int write(const std::string &filename)
Write a layer into a file.
Definition: autolayer.h:79
const size_t LAYER_FN_SIZE
max length of a layer's filename field
Definition: layer.h:30
pt * set_track0points(unsigned, const pt *src=00)
define the first track in a layer.
Definition: autolayer.cpp:71
int readTrack_GPX(const std::string &filename, layer *l)
read a track from a named file into the pointed-to layer
Definition: xml.cpp:1039
#define KJB(x)
Definition: l_util.h:9
int writeTrack_GPX(const std::string &filename, const layer &l)
write a track (stored in the indicated layer) into a named file
Definition: xml.cpp:1103
char filename[LAYER_FN_SIZE]
each layer is associated with a file
Definition: layer.h:87
void initLayer(layer *l)
clear all the fields of a layer (pointers assumed to be dangling)
Definition: layer.cpp:89
RAII approach to the old TopoFusion Layer data structure.
Definition: autolayer.h:26
AutoLayer(const std::string &filename)
ctor loads a layer from a named file
Definition: autolayer.h:53
layer * get_writable_ptr()
This is a "dangerous" method that lets you manipulate the Layer.
Definition: autolayer.h:73
~AutoLayer()
Dtor makes sure the layer resources are released.
Definition: autolayer.h:87
void destroyLayer(layer *l)
release memory in the layer's tracks and waypoints arrays
Definition: layer.cpp:105
XML processing prototypes.
definition used for layer
Definition: layer.h:82
AutoLayer()
default ctor makes a Layer ready for writing
Definition: autolayer.h:47
Support for error handling exception classes in libKJB.
void add_waypoint(const pt &, const char *, int)
A layer can hold a list of waypoints; this adds one to the list.
Definition: autolayer.cpp:117
definition for a TopoFusion pt
Definition: layer.h:34