1 4 package net.sourceforge.pmd.cpd; 5 6 import java.io.File ; 7 import java.io.FilenameFilter ; 8 9 public class CPPLanguage implements Language { 10 11 public static class CPPFileOrDirectoryFilter implements FilenameFilter { 12 public boolean accept(File dir, String filename) { 13 return filename.endsWith(".h") || filename.endsWith(".c") || filename.endsWith(".cpp") || filename.endsWith(".cxx") || filename.endsWith(".cc") || (new File (dir.getAbsolutePath() + fileSeparator + filename).isDirectory()); 14 } 15 } 16 17 public Tokenizer getTokenizer() { 18 return new CPPTokenizer(); 19 } 20 21 public FilenameFilter getFileFilter() { 22 return new CPPFileOrDirectoryFilter(); 23 } 24 } 25 | Popular Tags |