![]() |
FOSSology
4.6.0-rc1
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... | |
| string | Cleanup (const string &raw) const |
| void | TrimPunctuation (string &text) const |
| void | RemoveNoisePatterns (string &text) const |
| void | NormalizeCopyright (string &text) const |
| void | StripSuffixes (string &text) const |
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 | regExceptionCopy |
| rx::regex | regNonBlank |
| rx::regex | regSimpleCopyright |
| rx::regex | regSpdxCopyright |
| rx::regex | regRemoveFileStmt |
| rx::regex | regStripLicenseTrail |
| rx::regex | regStripTrademarkTrail |
| rx::regex | regStripAllRightReserveTrail |
Implementation of scanner class for copyright.
Definition at line 20 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 59 of file copyscan.cc.
|
private |
Regex for copyright statments
Definition at line 43 of file copyscan.hpp.
|
private |
Regex for exceptions in copyright
Definition at line 43 of file copyscan.hpp.
|
private |
Regex to find non blank statements
Definition at line 43 of file copyscan.hpp.
|
private |
Simple regex for copyright
Definition at line 43 of file copyscan.hpp.
|
private |
Regex for SPDX-FileCopyrightText
Definition at line 44 of file copyscan.hpp.