"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/src/cli/main.h" (12 May 2020, 2848 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "main.h": 3.52_vs_3.53.

    1 
    2 /*
    3 This file is part of Highlight.
    4 
    5 Highlight is free software: you can redistribute it and/or modify
    6 it under the terms of the GNU General Public License as published by
    7 the Free Software Foundation, either version 3 of the License, or
    8 (at your option) any later version.
    9 
   10 Highlight is distributed in the hope that it will be useful,
   11 but WITHOUT ANY WARRANTY; without even the implied warranty of
   12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   13 GNU General Public License for more details.
   14 
   15 You should have received a copy of the GNU General Public License
   16 along with Highlight.  If not, see <http://www.gnu.org/licenses/>.
   17 */
   18 
   19 
   20 #ifndef HIGHLIGHT_APP
   21 #define HIGHLIGHT_APP
   22 
   23 
   24 #include <iostream>
   25 #include <fstream>
   26 #include <string>
   27 #include <vector>
   28 #include <map>
   29 #include <iomanip>
   30 #include <cassert>
   31 
   32 #include "cmdlineoptions.h"
   33 #include "codegenerator.h"
   34 #include "help.h"
   35 #include "datadir.h"
   36 #include "version.h"
   37 #include "platform_fs.h"
   38 
   39 #define IO_ERROR_REPORT_LENGTH 5
   40 
   41 
   42 /// Main application class of the command line interface
   43 
   44 class HLCmdLineApp
   45 {
   46 
   47 public:
   48 
   49     HLCmdLineApp() {};
   50     ~HLCmdLineApp() {};
   51 
   52     /** Start application
   53       \param argc Number of command line arguments
   54       \param argv values of command line arguments
   55       \return EXIT_SUCCESS or EXIT_FAILURE
   56     */
   57     int run ( const int argc, const char *argv[] );
   58 
   59 private:
   60 
   61     DataDir dataDir;
   62     
   63 
   64     /** print version info*/
   65     void printVersionInfo();
   66 
   67     /** print configuration info*/
   68     void printConfigInfo ();
   69 
   70     /** print error message*/
   71     void printBadInstallationInfo();
   72 
   73     /** print input and output errors */
   74     void printIOErrorReport ( unsigned int numberErrorFiles, vector<string> & fileList, 
   75                               const string &action, const string &streamName );
   76 
   77     /** list installed  files
   78         \return true if files were found
   79     */
   80     int printInstalledFiles(const string& where, const string& wildcard, const string& kind, 
   81                             const string&option, const string& categoryFilterList="");
   82 
   83     /** print debug information
   84         \param  lang language definition
   85         \param langDefPath path to language definition
   86     */
   87     void printDebugInfo ( const highlight::SyntaxReader *lang,
   88                           const string &langDefPath );
   89     
   90     void printPersistentStates ( const highlight::SyntaxReader *lang);
   91 
   92     int getNumDigits ( int i );
   93 
   94     void printProgressBar ( int total, int count );
   95     void printCurrentAction ( const string&outfilePath,
   96                               int total, int count, int countWidth );
   97 
   98     bool readInputFilePaths ( vector<string> &fileList, string wildcard,
   99                               bool recursiveSearch );
  100 
  101     void printInstalledFiles();
  102 
  103     vector <string> collectPluginPaths(const vector<string>& plugins);
  104 };
  105 
  106 #endif