TkN 2.7.1
Toolkit for Nuclei
Loading...
Searching...
No Matches
tkensdf_ident_rec.h
1/********************************************************************************
2 * Copyright (c) : Université de Lyon 1, CNRS/IN2P3, UMR5822, *
3 * IP2I, F-69622 Villeurbanne Cedex, France *
4 * Normandie Université, ENSICAEN, UNICAEN, CNRS/IN2P3, *
5 * LPC Caen, F-14000 Caen, France *
6 * Contibutor(s) : *
7 * Jérémie Dudouet jeremie.dudouet@cnrs.fr [2020] *
8 * Diego Gruyer diego.gruyer@cnrs.fr [2020] *
9 * *
10 * Licensed under the MIT License <http://opensource.org/licenses/MIT>. *
11 * SPDX-License-Identifier: MIT *
12 ********************************************************************************/
13
23
24#ifndef tkensdf_ident_rec_H
25#define tkensdf_ident_rec_H
26
27#include <ios>
28
29#include "tkensdf_record.h"
30#include "tkstring.h"
31
32namespace tkn{
33
35
36public:
43 std::pair<int,int> fposition{0,0};
44 std::streampos fbytePosition{};
45 bool fis_adopted = false;
46
47public:
48
52
54 virtual bool set_record(const tkstring &_record) override;
56 virtual void analyse_record() override;
57
58 void set_current_position(int _pos) {fcurrentPosition = _pos;}
59 void set_start_position(int _pos) {fposition.first = _pos;}
60 void set_stpop_position(int _pos) {fposition.second = _pos;}
61 void set_byte_position(std::streampos _pos) {fbytePosition = _pos;}
62
64 int get_start_position() {return fposition.first;}
65 int get_stop_position() {return fposition.second;}
66 std::streampos get_byte_position() const {return fbytePosition;}
67
68 void clear() override;
69 void print(std::ostream &) const override;
70
71private:
72
73 tkstring get_dsid() const {return frecord.substr(9,30);}
74 tkstring get_dsref() const {return frecord.substr(39,26);}
75 tkstring get_pub() const {return frecord.substr(65,9);}
76 tkstring get_date() const {return frecord.substr(74,6);}
77 tkstring get_nuclide() const {return frecord.substr(0,5);}
78
79};
80}
81
82#endif
void print(std::ostream &) const override
virtual void analyse_record() override
analyse the record content
virtual bool set_record(const tkstring &_record) override
define the record from a string
std::pair< int, int > fposition
void set_stpop_position(int _pos)
void set_current_position(int _pos)
void set_start_position(int _pos)
void set_byte_position(std::streampos _pos)
std::streampos get_byte_position() const
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition tkstring.h:33
tkstring substr(size_type __pos=0, size_type __n=npos) const
Inlines.
Definition tkstring.h:160
Definition tklog.cpp:16