1 /******************************************************************************
3 * Copyright (C) 1997-2014 by Dimitri van Heesch.
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
16 #include "fileparser.h"
17 #include "outputgen.h"
19 void FileParser::parseCode(CodeOutputInterface &codeOutIntf,
20 const char *, // scopeName
21 const QCString & input,
23 bool, // isExampleBlock
24 const char *, // exampleName
28 bool, // inlineFragment
29 MemberDef *, // memberDef
31 Definition *, // searchCtx,
35 int lineNr = startLine!=-1 ? startLine : 1;
36 int length = input.length();
38 while (i<length && (endLine==-1 || lineNr<=endLine))
41 while (j<length && input[j]!='\n') j++;
42 QCString lineStr = input.mid(i,j-i);
43 codeOutIntf.startCodeLine(showLineNumbers);
44 if (showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr);
45 if (!lineStr.isEmpty()) codeOutIntf.codify(lineStr);
46 codeOutIntf.endCodeLine();