想象一下文件1:
#include "first.h"
#include "second.h"
#include "third.h"
// more code here
...
想象一下文件2:
#include "fifth.h"
#include "second.h"
#include "eigth.h"
// more code here
...
我想获取包含在文件2中但不包含在文件1中的头部信息,仅限这些行。 因此,运行时,文件1和文件2的差异将产生:
#include "fifth.h"
#include "eigth.h"
我知道如何在Perl/Python/Ruby中做到这一点,但我想在不使用其他编程语言的情况下实现它。
#include
将不匹配# include
,而"first.h"
将无法与子目录中的"../first.h"
匹配等。 - jw013