Changeset 147


Ignore:
Timestamp:
09/21/10 03:31:37 (9 years ago)
Author:
jls17
Message:

merged in changes from r143, r144 & r145; updated CMakeLists.txt to support 3.0.2 builds;

Location:
branches/work_302
Files:
9 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/work_302

  • branches/work_302/CMakeLists.txt

    r145 r147  
    1313ENDIF(NOT EXISTS ${AR_INCLUDE_PATH}) 
    1414 
    15 INCLUDE_DIRECTORIES(${AR_INCLUDE_PATH}/include tinyxml/ tclap/ ./) 
     15if (NOT DEFINED ZLIB_INCLUDE_PATH) 
     16  SET(ZLIB_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../libs/zlib") 
     17ENDIF(NOT DEFINED ZLIB_INCLUDE_PATH) 
     18 
     19INCLUDE_DIRECTORIES(${AR_INCLUDE_PATH}/include tinyxml/ tclap/ ./ ${ZLIB_INCLUDE_PATH}/include) 
    1620 
    1721INCLUDE (CheckIncludeFiles) 
     
    5357 util/ImageRefItem.cpp util/FieldRefItem.cpp util/AppTimer.cpp util/Util.cpp util/MissingMenuRefItem.cpp 
    5458 util/BlackListItem.cpp 
    55  AppConfig.cpp ARInside.cpp ConfigFile.cpp Main.cpp stdafx.cpp WindowsUtil.cpp 
     59 AppConfig.cpp ARInside.cpp ConfigFile.cpp gzstream.cpp Main.cpp stdafx.cpp WindowsUtil.cpp 
    5660) 
    5761SET (ARINSIDE_SRC_GIFS 
     
    8892IF(WIN32) 
    8993  SET(ARINSIDE_ARAPI_LIB arapi75 arapi71 arapi70) 
     94  SET(ZLIB_LIBNAMES zdll) 
    9095ELSE(WIN32) 
    9196  SET(ARINSIDE_ARAPI_LIB ar) 
     97  SET(ZLIB_LIBNAMES z) 
    9298ENDIF(WIN32) 
    9399 
    94100FIND_LIBRARY(ARS_API_LIB NAMES ${ARINSIDE_ARAPI_LIB} PATHS ${AR_INCLUDE_PATH}/lib) 
     101FIND_LIBRARY(ZLIB_LIB NAMES ${ZLIB_LIBNAMES} PATHS ${ZLIB_INCLUDE_PATH}/lib) 
    95102 
    96103IF (NOT ARS_API_LIB) 
    97104  MESSAGE(FATAL_ERROR "Could not find ${ARINSIDE_ARAPI_LIB} in '${AR_INCLUDE_PATH}/lib'! Please check or specify AR_INCLUDE_PATH variable") 
    98105ENDIF (NOT ARS_API_LIB) 
     106 
     107IF (NOT ZLIB_LIB) 
     108  MESSAGE(FATAL_ERROR "Could not find ${ZLIB_LIBNAMES} in '${ZLIB_INCLUDE_PATH}/lib'! Please check or specify ZLIB_INCLUDE_PATH variable") 
     109ENDIF (NOT ZLIB_LIB) 
    99110 
    100111# now import resources 
     
    127138 
    128139ADD_EXECUTABLE(arinside ${ARINSIDE_SRCS} ${ARINSIDE_RESOURCE_OBJECTS}) 
    129 TARGET_LINK_LIBRARIES(arinside ${ARS_API_LIB}) 
     140TARGET_LINK_LIBRARIES(arinside ${ARS_API_LIB} ${ZLIB_LIB}) 
    130141 
    131142#INSTALL(TARGETS arinside DESTINATION bin) 
  • branches/work_302/COPYING

    r142 r147  
    1 ARInside -- Copyright (C) 2009 Stefan Nerlich 
    2 ============================================= 
     1ARInside -- Copyright (C) 2010 Stefan Nerlich, LJ Longwing, John Luthgers 
     2========================================================================= 
    33This program is free software; you can redistribute it and/or modify it under  
    44the terms of the GNU General Public License as published by the Free Software  
  • branches/work_302/Main.cpp

    r142 r147  
    5555        int rpc = 0; 
    5656 
    57         cout << "ARInside Version " << AppVersion << endl; 
    58         cout << "Copyright (c) 2009 Stefan Nerlich" << endl << endl; 
    59  
    60         CmdLine cmd("ARInside -- http://arinside.org", ' ', AppVersion); 
     57        cout << "ARInside Version " << AppVersion << endl << endl; 
     58 
     59        CmdLine cmd("ARInside -- http://arinside.org\n" 
     60                          "Copyright (C) 2010 Stefan Nerlich, LJ Longwing, John Luthgers\n" 
     61                                                        "This program comes with ABSOLUTELY NO WARRANTY, is free software, and you are welcome to " 
     62                                                        "redistribute it under certain conditions; see COPYING file for more details.",  
     63                                                        ' ', AppVersion); 
    6164 
    6265        ValueArg<string> iniArg("i", "ini", "Application settings filename", true, "settings.ini", "string"); 
     
    104107 
    105108                // override settings with values specified by the command line  
    106                 if (!server.empty() || appConfig.serverName.empty()) 
     109                if (serverArg.isSet()) 
    107110                        appConfig.serverName = server; 
    108111 
    109                 if (!output.empty() || appConfig.targetFolder.empty()) 
     112                if (outputFolder.isSet()) 
    110113                        appConfig.targetFolder = output; 
    111114 
    112                 if (!login.empty() || appConfig.userName.empty()) 
     115                if (loginArg.isSet()) 
    113116                        appConfig.userName = login; 
    114117 
    115                 if (!pwd.empty() || appConfig.password.empty()) 
     118                if (pwdArg.isSet()) 
    116119                        appConfig.password = pwd; 
    117120 
    118                 if (tcp > 0) 
     121                if (tcpArg.isSet()) 
    119122                        appConfig.tcpPort = tcp; 
    120123 
    121                 if (rpc > 0) 
     124                if (rpcArg.isSet()) 
    122125                        appConfig.rpcPort = rpc; 
    123126 
     
    128131                        unsigned int missingCount = 0; 
    129132 
    130                         if (appConfig.serverName.empty()) 
     133                        if (!appConfig.fileMode && appConfig.serverName.empty()) 
    131134                        { 
    132135                                missingCount++; 
     
    152155                } 
    153156 
     157                // validate the path of the target folder 
     158                if (appConfig.targetFolder.empty()) 
     159                { 
     160                        cout << "[ERR] Target folder setting is missing or not setup correctly!" << endl; 
     161                        throw ExitException(1); 
     162                } 
     163                 
     164                string fullOutputPath = CWindowsUtil::GetRealPathName(appConfig.targetFolder); 
     165                if (CUtil::StrEndsWith(fullOutputPath, ":\\") || CUtil::StrEndsWith(fullOutputPath, ":/") || fullOutputPath == "/") 
     166                { 
     167                        cout << "[ERR] The target directory points to the root of the device. This is not allowed!" << endl; 
     168                        throw ExitException(1); 
     169                } 
     170 
    154171                CWindowsUtil winUtil(appConfig);                 
    155                 CARInside arInside(appConfig);; 
     172                CARInside arInside(appConfig); 
    156173 
    157174                //Delete existing files 
     
    163180 
    164181                //Create the target directory specified in the configuration files 
     182                //TODO: CreateAppDirectory returns false if the directory already exists .. this should be changed so 
     183                //      we can check if there is something going wrong and stop the process!! 
    165184                winUtil.CreateAppDirectory(); 
    166185 
     
    214233                else 
    215234                { 
     235                        // TODO: ValidateTargetDir returns 0 on success. On error there is no information about the error 
     236                        // at all .. only "whoops, cant create directory" .. hell yes, and now? where is my glass sphere... 
    216237                        cout << "Failed to create target directory: " << appConfig.targetFolder << endl; 
    217238                        result = AR_RETURN_ERROR; 
     
    238259        catch(AppException &e) 
    239260        { 
    240                 cout << endl << "AppException: " << e.typeDescription() << endl << "Description: " << e.error();         
     261                cout << endl << "AppException: " << e.typeDescription() << endl << "Description: " << e.error() << endl;         
    241262        } 
    242263        catch (ArgException &e) 
     
    272293                config.readInto<string>(cfg.companyName, "CompanyName", ""); 
    273294                config.readInto<string>(cfg.companyUrl, "CompanyUrl", ""); 
    274                 config.readInto<string>(cfg.targetFolder, "TargetFolder", "DefaultOutputFolder"); 
     295                config.readInto<string>(cfg.targetFolder, "TargetFolder", ""); 
    275296                config.readInto<bool>(cfg.fileMode, "FileMode", false); 
    276297                config.readInto<string>(cfg.objListXML, "ObjListXML", ""); 
  • branches/work_302/RELEASE_NOTES.txt

    r133 r147  
    44E - Enhancement 
    55D - Defect fixed 
     6 
     72010-09-01 
     8[3.0.1] 
     9E - All command line options except ini (-i) are now optional (all settings are configurable within the ini file) 
     10E - New command line option "-o" to specify the output directory 
     11E - All objects are now loaded with the ARGetMultiple-functions to improve performance 
     12E - Internal object and memory usage optimized 
     13E - You can now blacklist images 
     14E - Now the filename/URL of the pages is generated by the object name instead of a consecutive number 
     15    (you can use the OldNaming setting to enabled the old file naming)  
     16E - Added linux & SunOS platform support 
     17E - Program stops if TargetFolder points to the root directory [#64] 
     18 
     19D - No attachment fields were listed for attachment pool [#82] 
     20D - Server informations were displayed incorrectly (wrong value for wrong server info) 
     21D - Rare crash while decoding qualifier fixed [#78] 
     22D - fixed: Loading of groups using server version 6.3 
     23D - fixed: crashing during "Checking filter references" using server version 6.3 
     24D - fixed: crash while documenting schema details using server version 6.3 (was caused by audit documentation) 
     25D - fixed: objects with leading space(s) weren't listed currectly (crashed in some cases) 
    626 
    7272010-03-01 
  • branches/work_302/WindowsUtil.cpp

    r137 r147  
    1818#include "resource.h" 
    1919#include "WindowsUtil.h" 
     20#include "AppException.h" 
    2021 
    2122#include <sys/types.h> 
     
    2526#include <windows.h> 
    2627#include <direct.h> 
     28#else 
     29#include <errno.h> 
    2730#endif // WIN32 
    2831 
     
    206209        return 0; 
    207210} 
     211 
     212string CWindowsUtil::GetRealPathName(const std::string &path) 
     213{ 
     214#ifdef WIN32 
     215        char buffer[MAX_PATH]; buffer[0] = 0; 
     216        LPSTR *filePos = NULL; 
     217 
     218        DWORD len = GetFullPathName(path.c_str(), MAX_PATH, buffer, filePos); 
     219        if (len > MAX_PATH || len == 0) 
     220        { 
     221                stringstream tmp; 
     222                tmp << "Error: could not retrieve the full output path! (" << GetLastError() << ")"; 
     223                throw AppException(tmp.str(), "filesystem");                     
     224        } 
     225#else 
     226        // NOTE: realpath doesn't return the full path under SunOS if a relativ path is specified. 
     227        char buffer[PATH_MAX]; buffer[0] = 0; 
     228        char *p; 
     229        p = realpath(path.c_str(), buffer); 
     230        if (p == NULL) 
     231        { 
     232                if (errno == ENOENT) return path; 
     233                stringstream tmp; 
     234                tmp << strerror(errno) << ": " << path; 
     235                throw AppException(tmp.str(), "filesystem");                     
     236        } 
     237#endif 
     238        return buffer; 
     239} 
  • branches/work_302/WindowsUtil.h

    r137 r147  
    2727        bool CreateAppDirectory(); 
    2828        int CreateSubDirectory(string name); 
     29        static std::string GetRealPathName(const std::string &path); 
    2930 
    3031private: 
  • branches/work_302/stdafx.h

    r133 r147  
    2626#include <time.h> 
    2727#include <stdlib.h> // JLS17_LINUX 
     28#include <stdio.h> 
    2829 
    2930#include "util/Util.h" 
  • branches/work_302/util/Util.cpp

    r94 r147  
    151151        return buffer; 
    152152} 
     153 
     154bool CUtil::StrEndsWith(const std::string &str, const std::string &search) 
     155{ 
     156        if (search.size() > str.size()) return false; 
     157        return equal(str.end() - search.size(), str.end(), search.begin()); 
     158} 
  • branches/work_302/util/Util.h

    r86 r147  
    4141        static string String2Comp(string strIn); 
    4242        static string StrReplace(const std::string &search, const std::string &replace, std::string searchin); 
     43        static bool StrEndsWith(const std::string &str, const std::string &search); 
    4344        //static int SplitString(const string& input, const string& delimiter, vector<string>& results, bool includeEmpties);    
    4445 
Note: See TracChangeset for help on using the changeset viewer.