Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.
/ PureSource Public archive

A C++ header-only helper library to remove comments from Json. (any c-style source code)

License

Notifications You must be signed in to change notification settings

Qv2ray/PureSource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PureSource

A C++ helper library to remove comments from any C style source codes.

Examples

  • Please check the examples folder for usage in Qt or check the test file
source:    //this is a comment   
target:    

source:    this is not a comment   
target:    this is not a comment   

source:    "//this is not a comment, it's in the string"   
target:    "//this is not a comment, it's in the string"   

source:    "//this is not a comment, it's in the string", but //those are comments to be removed.   
target:    "//this is not a comment, it's in the string", but 

source:    "//this is not a comment, it's in the string \", and //those are not comments neither"   
target:    "//this is not a comment, it's in the string \", and //those are not comments neither"   

source:    "//this is not a comment, it's in the string \\", but //those are comments since the string is terminated   
target:    "//this is not a comment, it's in the string \\", but 

source:    '//this is not a comment, it's in the string, // but, only for the first part and those are comments since the string is terminated   
target:    '//this is not a comment, it's in the string, 

source:    "//this is not a comment, it's in the string ", and '//those are not comments as well' since in the //single qoutes."   
target:    "//this is not a comment, it's in the string ", and '//those are not comments as well' since in the 

source:    /*this is a comment*/ my actrual data   
target:     my actrual data   

source:    /**/ my actrual data /**/  
target:     my actrual data   

source:    /**/ my actr/**/ual data /**/  
target:     my actrual data   

source:    /**/ my actr/****////**/**///**/**/ual data /**/  
target:     my actr

source:    '//this is not a comment, it's i/**/n the st/**/ring, // but, on/**/ly for the first part and those are comments since the string is terminated   
target:    '//this is not a comment, it's in the string, 

source:    "//this is not a comment, it's /*in the string*/ ", and '//those are not comments as well' since in the single qoutes./* and in the comments */
target:    "//this is not a comment, it's /*in the string*/ ", and '//those are not comments as well' since in the single qoutes.

License:

PureSource is using MIT