TkN 2.4
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 "tkensdf_record.h"
28#include "tkstring.h"
29
30namespace tkn{
31
33
34public:
41 std::pair<int,int> fposition{0,0};
42 bool fis_adopted = false;
43
44public:
45
49
51 virtual bool set_record(const tkstring &_record) override;
53 virtual void analyse_record() override;
54
55 void set_current_position(int _pos) {fcurrentPosition = _pos;}
56 void set_start_position(int _pos) {fposition.first = _pos;}
57 void set_stpop_position(int _pos) {fposition.second = _pos;}
58
60 int get_start_position() {return fposition.first;}
61 int get_stop_position() {return fposition.second;}
62
63 void clear() override;
64 void print(std::ostream &) const override;
65
66private:
67
68 tkstring get_dsid() const {return frecord.substr(9,30);}
69 tkstring get_dsref() const {return frecord.substr(39,26);}
70 tkstring get_pub() const {return frecord.substr(65,9);}
71 tkstring get_date() const {return frecord.substr(74,6);}
72 tkstring get_nuclide() const {return frecord.substr(0,5);}
73
74};
75}
76
77#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)
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition tkstring.h:31
tkstring substr(size_type __pos=0, size_type __n=npos) const
Inlines.
Definition tkstring.h:156
Definition tklog.cpp:16