PhoenixLecture  2.0.0
Set of tools to make lectures
psrc_split_lib.h File Reference
#include "openFileStream.h"
#include "PFileParser.h"
+ Include dependency graph for psrc_split_lib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 PTypeCode
 

Enumerations

enum  PTypeCode::PTypeCode { PTypeCode::CODE , PTypeCode::PTEX_COMMENT }
 Get the type of the parsed text. More...
 

Functions

PPath getSplitOutputFileName (const PPath &outputFile, bool isPlatexMode)
 Get the output file name. More...
 
bool processFile (const PPath &outputFile, const PPath &inputFile, bool keepComment, bool keepTex, bool removefirstcomment, bool isPlatexMode)
 Process the input file. More...
 

Function Documentation

◆ getSplitOutputFileName()

PPath getSplitOutputFileName ( const PPath outputFile,
bool  isPlatexMode 
)

Get the output file name.

Parameters
outputFile: name of the output file
isPlatexMode: true if we want to create ptex output files
Returns
output file name

Definition at line 165 of file psrc_split_lib.cpp.

165  {
166  PString nameOutputFile(outputFile);
167  PString ext(outputFile.getExtension());
168  if(isPlatexMode && ext != "ptex"){
169  nameOutputFile += ".ptex";
170  }
171  return nameOutputFile;
172 }
PString getExtension() const
Get file extension.
Definition: PPath.cpp:252
Extends the std::string.
Definition: PString.h:16

References PPath::getExtension().

Referenced by processFile(), and processFileOrDir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processFile()

bool processFile ( const PPath outputFile,
const PPath inputFile,
bool  keepComment,
bool  keepTex,
bool  removefirstcomment,
bool  isPlatexMode 
)

Process the input file.

Parameters
outputFile: file to be written
inputFile: file to be red
keepComment: true to keep the comments of the targeted language in the output file
keepTex: true to keep the ptex comment, false otherwise
removefirstcomment: remove the first comment of the file
isPlatexMode: true to add begin and end environnement in the output file, false otherwise
Returns
true on success, false otherwise

Definition at line 183 of file psrc_split_lib.cpp.

References createPTexFile(), PPath::eraseExtension(), PPath::getExtension(), PPath::getFileName(), and getSplitOutputFileName().

+ Here is the call graph for this function: