4 #pragma warning ( disable : 4786 )
7 #include "strip_comments.h"
9 void strip_comments ( std::string
& s
, bool strip_lf
)
15 if ( src
[0] == '/' && src
[1] == '/' )
18 while ( *src
&& *src
!= '\n' )
21 src
++; // skip newline
23 else if ( src
[0] == '/' && src
[1] == '*' )
26 char* newsrc
= strstr ( src
, "*/" );
30 //while ( *src && ( src[0] != '*' || src[1] != '/' ) )
35 else if ( src
[0] == '\r' && strip_lf
)
42 s
.resize ( dst
-&s
[0] );