FOSSology  4.4.0
Open Source License Compliance by Open Source Software
hCopyrightScanner Class Reference

Implementation of scanner class for copyright. More...

#include <copyscan.hpp>

Inheritance diagram for hCopyrightScanner:
Inheritance graph
Collaboration diagram for hCopyrightScanner:
Collaboration graph

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
 

Detailed Description

Implementation of scanner class for copyright.

Definition at line 17 of file copyscan.hpp.

Constructor & Destructor Documentation

◆ hCopyrightScanner()

hCopyrightScanner::hCopyrightScanner ( )

Constructor for default hCopyrightScanner.

Initialize all regex values

Definition at line 20 of file copyscan.cc.

Member Function Documentation

◆ ScanString()

void hCopyrightScanner::ScanString ( const string &  s,
list< match > &  out 
) const
virtual

Scan a given string for copyright statements.

Given a string s, scans for copyright statements using regCopyrights. Then checks for an regException match.

Parameters
[in]sString to work on
[out]outList 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

  • spaces and punctuation
  • no word of two letters, no two consecutive digits

Implements scanner.

Definition at line 46 of file copyscan.cc.

Member Data Documentation

◆ regCopyright

rx::regex hCopyrightScanner::regCopyright
private

Regex for copyright statments

Definition at line 35 of file copyscan.hpp.

◆ regException

rx::regex hCopyrightScanner::regException
private

Regex for exceptions in copyright

Definition at line 35 of file copyscan.hpp.

◆ regNonBlank

rx::regex hCopyrightScanner::regNonBlank
private

Regex to find non blank statements

Definition at line 35 of file copyscan.hpp.

◆ regSimpleCopyright

rx::regex hCopyrightScanner::regSimpleCopyright
private

Simple regex for copyright

Definition at line 35 of file copyscan.hpp.

◆ regSpdxCopyright

rx::regex hCopyrightScanner::regSpdxCopyright
private

Regex for SPDX-FileCopyrightText

Definition at line 35 of file copyscan.hpp.


The documentation for this class was generated from the following files: