FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
Implementation of scanner class for copyright. More...
#include <copyscan.hpp>
Public Member Functions | |
void | ScanString (const string &s, list< match > &results) const |
Scan a given string for copyright statements. More... | |
hCopyrightScanner () | |
Constructor for default hCopyrightScanner. More... | |
Public Member Functions inherited from scanner | |
virtual void | ScanFile (const string &fileName, list< match > &results) const |
Helper function to scan file. More... | |
Private Attributes | |
rx::regex | regCopyright |
rx::regex | regException |
rx::regex | regNonBlank |
rx::regex | regSimpleCopyright |
rx::regex | regSpdxCopyright |
Implementation of scanner class for copyright.
Definition at line 17 of file copyscan.hpp.
hCopyrightScanner::hCopyrightScanner | ( | ) |
Constructor for default hCopyrightScanner.
Initialize all regex values
Definition at line 20 of file copyscan.cc.
Scan a given string for copyright statements.
Given a string s, scans for copyright statements using regCopyrights. Then checks for an regException match.
[in] | s | String to work on |
[out] | out | List of matchs |
Not an exception, this means that at foundPos there is a copyright statement. Try to find the proper beginning and end before adding it to the out list.
Copyright statements should extend over the following lines until a blank line or a line with a new copyright statement is found. A blank line may consist of
Implements scanner.
Definition at line 46 of file copyscan.cc.
|
private |
Regex for copyright statments
Definition at line 35 of file copyscan.hpp.
|
private |
Regex for exceptions in copyright
Definition at line 35 of file copyscan.hpp.
|
private |
Regex to find non blank statements
Definition at line 35 of file copyscan.hpp.
|
private |
Simple regex for copyright
Definition at line 35 of file copyscan.hpp.
|
private |
Regex for SPDX-FileCopyrightText
Definition at line 35 of file copyscan.hpp.