FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ojomatch.hpp
1 /*
2  * Copyright (C) 2019, Siemens AG
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * version 2 as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16  */
17 
18 #ifndef SRC_OJO_AGENT_OJOMATCH_HPP_
19 #define SRC_OJO_AGENT_OJOMATCH_HPP_
20 
21 #include <string>
22 
27 struct ojomatch
28 {
39  long int start, end, len, license_fk;
40 
45  std::string content;
53  ojomatch(const long int s, const long int e, const long int l,
54  const std::string c) :
55  start(s), end(e), len(l), content(c)
56  {
57  license_fk = -1;
58  }
63  start(-1), end(-1), len(-1), license_fk(-1), content("")
64  {
65  }
66 
67  bool operator==(const std::string& matchcontent) const
68  {
69  if(this->content.compare(matchcontent) == 0)
70  {
71  return true;
72  }
73  else
74  {
75  return false;
76  }
77  }
78 
79  bool operator==(const ojomatch& matchcontent) const
80  {
81  if(this->content.compare(matchcontent.content) == 0)
82  {
83  return true;
84  }
85  else
86  {
87  return false;
88  }
89  }
90 };
91 
92 #endif /* SRC_OJO_AGENT_OJOMATCH_HPP_ */
long int end
Definition: ojomatch.hpp:39
int s
The socket that the CLI will use to communicate.
Definition: fo_cli.c:48
ojomatch()
Definition: ojomatch.hpp:62
ojomatch(const long int s, const long int e, const long int l, const std::string c)
Definition: ojomatch.hpp:53
long int license_fk
Definition: ojomatch.hpp:39
long int len
Definition: ojomatch.hpp:39
long int start
Definition: ojomatch.hpp:39
Store the results of a regex match.
Definition: ojomatch.hpp:27