Blame src/fileparser.cpp

Packit Service 50c9f2
/******************************************************************************
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Permission to use, copy, modify, and distribute this software and its
Packit Service 50c9f2
 * documentation under the terms of the GNU General Public License is hereby
Packit Service 50c9f2
 * granted. No representations are made about the suitability of this software
Packit Service 50c9f2
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit Service 50c9f2
 * See the GNU General Public License for more details.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Documents produced by Doxygen are derivative works derived from the
Packit Service 50c9f2
 * input used in their production; they are not affected by this license.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 */
Packit Service 50c9f2
Packit Service 50c9f2
#include "fileparser.h"
Packit Service 50c9f2
#include "outputgen.h"
Packit Service 50c9f2
Packit Service 50c9f2
void FileParser::parseCode(CodeOutputInterface &codeOutIntf,
Packit Service 50c9f2
               const char *,     // scopeName
Packit Service 50c9f2
               const QCString &     input,
Packit Service 50c9f2
               SrcLangExt,       // lang
Packit Service 50c9f2
               bool,             // isExampleBlock
Packit Service 50c9f2
               const char *,     // exampleName
Packit Service 50c9f2
               FileDef *            fileDef,
Packit Service 50c9f2
               int                  startLine,
Packit Service 50c9f2
               int                  endLine,
Packit Service 50c9f2
               bool,             // inlineFragment
Packit Service 50c9f2
               MemberDef *,      // memberDef
Packit Service 50c9f2
               bool                 showLineNumbers,
Packit Service 50c9f2
               Definition *,     // searchCtx,
Packit Service 50c9f2
               bool              // collectXRefs
Packit Service 50c9f2
              )
Packit Service 50c9f2
{
Packit Service 50c9f2
  int lineNr = startLine!=-1 ? startLine : 1;
Packit Service 50c9f2
  int length = input.length();
Packit Service 50c9f2
  int i=0;
Packit Service 50c9f2
  while (i
Packit Service 50c9f2
  {
Packit Service 50c9f2
    int j=i;
Packit Service 50c9f2
    while (j
Packit Service 50c9f2
    QCString lineStr = input.mid(i,j-i);
Packit Service 50c9f2
    codeOutIntf.startCodeLine(fileDef != 0 && showLineNumbers);
Packit Service 50c9f2
    if (fileDef != 0 && showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr);
Packit Service 50c9f2
    if (!lineStr.isEmpty()) codeOutIntf.codify(lineStr);
Packit Service 50c9f2
    codeOutIntf.endCodeLine();
Packit Service 50c9f2
    lineNr++;
Packit Service 50c9f2
    i=j+1;
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2