aboutsummaryrefslogtreecommitdiff
path: root/src/gloseq.hpp
blob: 7d75ddcb4d53c5325ae98a8dd7fbc8c9d24c31b5 (plain)
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
/*
    Copyright (C) 2014 BARRATERO Laurent                                   

    AeroUp 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 3 of the License, or
    (at your option) any later version.

    Aeroup 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. 
*/

/*
 *       Filename:  gloseq.hpp
 *
 *    Description:  
 *
 *        Version:  0.3.2
 *        Created:  27/12/2013 10:40:44
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  BARATTERO Laurent, laurentba<at>larueluberlu.net
 *   Organization:  La rue Luberlu
 */

#ifndef  gloseq_INC
#define  gloseq_INC

#include <string>
#include <vector>
#include <fstream>
#include <iterator>
#include <algorithm>

#include "global.hpp"
#include "buffer.hpp"
#include "buffermanager.hpp"
#include "rules.hpp"
#include "serialprop.hpp"
#include "config.h"

#if HAVE_LIBBOOST_REGEX
  #include "regboost.hpp"
#else
  #include "reglinux.hpp"
#endif


/*
 *        Class:  GloSeq
 *  Description:  Contains all the processing related to the glo file.
 */
class GloSeq
{
  public:
    void verify();
    void upload(SerialProp & ser);

    GloSeq (std::string fileName);  /* constructor      */



  private:
    void cleanLine(std::string& rline);

    const char SP  = 0x20;
    const char TAB = 0x09;
    const char CR  = 0x0d;
    const char LF  = 0x0a;
    const int NOT_VALID = -1;

    std::string file_name;
    std::ifstream glofile;

    struct command
    {
      std::string line;
      int cmd_type;
      int nb_line;
    };
    std::vector <command> cmdTab;


    Buffer buff;
    Rules rules;
    BufferManager buffManager;
    

}; /* -----  end of class GloSeq  ----- */


#endif   /* ----- #ifndef gloseq_INC  ----- */