Jack2 1.9.6

JackArgParser.h

00001 /*
00002   Copyright (C) 2006-2008 Grame
00003 
00004   This program is free software; you can redistribute it and/or modify
00005   it under the terms of the GNU Lesser General Public License as published by
00006   the Free Software Foundation; either version 2.1 of the License, or
00007   (at your option) any later version.
00008 
00009   This program is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012   GNU Lesser General Public License for more details.
00013 
00014   You should have received a copy of the GNU Lesser General Public License
00015   along with this program; if not, write to the Free Software
00016   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 
00018 */
00019 
00020 #ifndef __JackArgParser__
00021 #define __JackArgParser__
00022 
00023 #include "jslist.h"
00024 #include "driver_interface.h"
00025 #include "JackCompilerDeps.h"
00026 #include "JackError.h"
00027 
00028 #include <string>
00029 #include <algorithm>
00030 #include <vector>
00031 #include <iostream>
00032 #include <fstream>
00033 
00034 namespace Jack
00035 {
00036 
00037     class SERVER_EXPORT JackArgParser
00038     {
00039         private:
00040 
00041             std::string fArgString;
00042             int fArgc;
00043             std::vector<std::string> fArgv;
00044 
00045         public:
00046 
00047             JackArgParser ( const char* arg );
00048             ~JackArgParser();
00049             std::string GetArgString();
00050             int GetNumArgv();
00051             int GetArgc();
00052             int GetArgv ( std::vector<std::string>& argv );
00053             int GetArgv ( char** argv );
00054             void DeleteArgv ( const char** argv );
00055             bool ParseParams ( jack_driver_desc_t* desc, JSList** param_list );
00056             void FreeParams ( JSList* param_list );
00057     };
00058 
00059 }
00060 
00061 #endif