Ice Sheet System Model  4.18
Code documentation
Public Member Functions
KML_File Class Reference

#include <KML_File.h>

Inheritance diagram for KML_File:
KML_Object Object

Public Member Functions

 KML_File ()
 
 ~KML_File ()
 
void Echo ()
 
void DeepEcho ()
 
void DeepEcho (const char *indent)
 
void Write (FILE *fid, const char *indent)
 
void Read (FILE *fid, char *kstr)
 
void WriteExp (FILE *fid, const char *nstr, int sgn, double cm, double sp)
 
int Id ()
 
int ObjectEnum ()
 
Objectcopy ()
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
- Public Member Functions inherited from KML_Object
 KML_Object ()
 
 ~KML_Object ()
 
int Id ()
 
int ObjectEnum ()
 
Objectcopy ()
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
virtual void AddAttrib (const char *name, const char *value)
 
virtual void WriteAttrib (FILE *fid, const char *indent)
 
virtual void AddCommnt (int ncom, char **pcom)
 
virtual void AddCommnt (char *value)
 
virtual void WriteCommnt (FILE *fid, const char *indent)
 
- Public Member Functions inherited from Object
virtual ~Object ()
 

Additional Inherited Members

- Data Fields inherited from KML_Object
DataSetattrib
 
DataSetcommnt
 
DataSetkmlobj
 

Detailed Description

Definition at line 16 of file KML_File.h.

Constructor & Destructor Documentation

◆ KML_File()

KML_File::KML_File ( )

Definition at line 20 of file KML_File.cpp.

20  {/*{{{*/
21 
22  ;
23 
24 }

◆ ~KML_File()

KML_File::~KML_File ( )

Definition at line 26 of file KML_File.cpp.

26  {/*{{{*/
27 
28  ;
29 
30 }

Member Function Documentation

◆ Echo()

void KML_File::Echo ( void  )
virtual

Reimplemented from KML_Object.

Definition at line 34 of file KML_File.cpp.

34  {/*{{{*/
35 
36  bool flag=true;
37 
38  if(flag) _printf0_("KML_File:\n");
40 
41  return;
42 }

◆ DeepEcho() [1/2]

void KML_File::DeepEcho ( void  )
virtual

Reimplemented from KML_Object.

Definition at line 44 of file KML_File.cpp.

44  {/*{{{*/
45 
46  char indent[81]="";
47 
48  KML_File::DeepEcho(indent);
49 
50  return;
51 }

◆ DeepEcho() [2/2]

void KML_File::DeepEcho ( const char *  indent)
virtual

Reimplemented from KML_Object.

Definition at line 53 of file KML_File.cpp.

53  {/*{{{*/
54 
55  bool flag=true;
56 
57  if(flag) _printf0_(indent << "KML_File:\n");
58  KML_Object::DeepEcho(indent);
59 
60  return;
61 }

◆ Write()

void KML_File::Write ( FILE *  fid,
const char *  indent 
)
virtual

Implements KML_Object.

Definition at line 63 of file KML_File.cpp.

63  {/*{{{*/
64 
65  fprintf(filout,"%s<kml",indent);
66  WriteAttrib(filout," ");
67  fprintf(filout,">\n");
68  WriteCommnt(filout,indent);
69 
70  KML_Object::Write(filout,indent);
71 
72  fprintf(filout,"%s</kml>\n",indent);
73 
74  return;
75 }

◆ Read()

void KML_File::Read ( FILE *  fid,
char *  kstr 
)
virtual

Implements KML_Object.

Definition at line 77 of file KML_File.cpp.

77  {/*{{{*/
78 
79  char* kstri;
80  int ncom=0;
81  char** pcom=NULL;
82 
83 /* get object attributes and check for solo tag */
84 
85  if (KMLFileTagAttrib(this,
86  kstr))
87  return;
88 
89 /* loop over and process fields within opening and closing tags */
90 
91  while((kstri=KMLFileToken(fid, &ncom,&pcom))){
92  if (!strncmp(kstri,"</kml", 5)) {
93  xDelete<char>(kstri);
94  break;
95  }
96  else if (!strncmp(kstri,"</",2))
97  {_error_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
98  else if (strncmp(kstri,"<",1))
99  {_error_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
100 
101  else if (!strncmp(kstri,"<",1))
102  KML_Object::Read(fid,kstri);
103 
104  xDelete<char>(kstri);
105  }
106 
107  this->AddCommnt(ncom,pcom);
108 
109  for(; ncom>0; ncom--) xDelete<char>(pcom[ncom-1]);
110  xDelete<char*>(pcom);
111 
112  return;
113 }

◆ WriteExp()

void KML_File::WriteExp ( FILE *  fid,
const char *  nstr,
int  sgn,
double  cm,
double  sp 
)
virtual

Reimplemented from KML_Object.

Definition at line 115 of file KML_File.cpp.

115  {/*{{{*/
116 
117  int i;
118 
119 /* loop over the kml objects for the file */
120 
121  for (i=0; i<kmlobj->Size(); i++)
122  ((KML_Object *)kmlobj->GetObjectByOffset(i))->WriteExp(fid,nstr,sgn,cm,sp);
123 
124  return;
125 }

◆ Id()

int KML_File::Id ( void  )
inlinevirtual

Implements Object.

Definition at line 31 of file KML_File.h.

31 {_error_("Not implemented yet.");};

◆ ObjectEnum()

int KML_File::ObjectEnum ( void  )
inlinevirtual

Implements Object.

Definition at line 32 of file KML_File.h.

32 {_error_("Not implemented yet.");};

◆ copy()

Object* KML_File::copy ( void  )
inlinevirtual

Implements Object.

Definition at line 33 of file KML_File.h.

33 {_error_("Not implemented yet.");};

◆ Marshall()

void KML_File::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
inlinevirtual

Implements Object.

Definition at line 34 of file KML_File.h.

34 { _error_("not implemented yet!");};

The documentation for this class was generated from the following files:
DataSet::Size
int Size()
Definition: DataSet.cpp:399
KML_Object
Definition: KML_Object.h:13
_printf0_
#define _printf0_(StreamArgs)
Definition: Print.h:29
KML_Object::WriteAttrib
virtual void WriteAttrib(FILE *fid, const char *indent)
Definition: KML_Object.cpp:288
KMLFileTagAttrib
int KMLFileTagAttrib(KML_Object *kobj, char *ktag)
Definition: KMLFileReadUtils.cpp:287
KML_File::DeepEcho
void DeepEcho()
Definition: KML_File.cpp:44
KML_Object::Read
virtual void Read(FILE *fid, char *kstr)=0
Definition: KML_Object.cpp:143
KML_Object::kmlobj
DataSet * kmlobj
Definition: KML_Object.h:19
KMLFileToken
char * KMLFileToken(FILE *fid, int *pncom=NULL, char ***ppcom=NULL)
Definition: KMLFileReadUtils.cpp:18
KML_Object::Write
virtual void Write(FILE *fid, const char *indent)=0
Definition: KML_Object.cpp:122
KML_Object::DeepEcho
virtual void DeepEcho()
Definition: KML_Object.cpp:72
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
KML_Object::Echo
virtual void Echo()
Definition: KML_Object.cpp:61
DataSet::GetObjectByOffset
Object * GetObjectByOffset(int offset)
Definition: DataSet.cpp:334
KML_Object::AddCommnt
virtual void AddCommnt(int ncom, char **pcom)
Definition: KML_Object.cpp:301
KML_Object::WriteCommnt
virtual void WriteCommnt(FILE *fid, const char *indent)
Definition: KML_Object.cpp:326