forked from therion/therion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththdb2dji.cxx
87 lines (77 loc) · 2.31 KB
/
thdb2dji.cxx
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
/**
* @file thdb2dji.cxx
*/
/* Copyright (C) 2000 Stacho Mudrak
*
* $Date: $
* $RCSfile: $
* $Revision: $
*
* --------------------------------------------------------------------
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* --------------------------------------------------------------------
*/
#include "thdb2dji.h"
#include "thdatabase.h"
#include "thexception.h"
thdb2dji::thdb2dji()
{
this->prev_item = NULL;
this->next_item = NULL;
this->prev_list = NULL;
this->next_list = NULL;
this->prev_list_item = NULL;
this->next_list_item = NULL;
this->name.clear();
this->mark = NULL;
this->is_active = false;
this->point = NULL;
this->cp1 = NULL;
this->cp2 = NULL;
this->line_point = NULL;
this->object = NULL;
}
void thdb2dji::parse_item(char * istr)
{
/*
thdb.buff_tmp.strcpy(istr);
char * p_name = thdb.buff_tmp.get_buffer(), * s_name = "", * tmpch;
tmpch = p_name;
size_t snl = strlen(istr), sni;
for(sni = 0; sni < snl; sni++, tmpch++)
if (*tmpch == '@') {
*tmpch = 0;
s_name = tmpch + 1;
break;
}
thsplit_strings(& thdb.db2d.mbf, p_name, ':');
*/
thsplit_strings(& thdb.db2d.mbf, istr, ':');
int npar = thdb.db2d.mbf.get_size();
char ** pars = thdb.db2d.mbf.get_buffer();
if (npar == 2) {
this->mark = thdb.strstore(pars[1]);
if (!th_is_keyword(this->mark))
ththrow("line mark not a keyword -- {}",istr);
}
/*
thdb.buff_enc.strcpy(pars[0]);
if (strlen(s_name) > 0) {
thdb.buff_enc += "@";
thdb.buff_enc += s_name;
}*/
// thparse_objectname(this->name, & thdb.buff_stations, thdb.buff_enc.get_buffer());
thparse_objectname(this->name, & thdb.buff_stations, pars[0]);
}