Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 10, 2011, 9:03:59 PM (13 years ago)
Author:
rgrieder
Message:

Resolved problems with different Boost filesystem versions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/src/libraries/core/command/ArgumentCompletionFunctions.cc

    r8066 r8225  
    3535
    3636#include <map>
    37 #include <boost/version.hpp>
    3837#include <boost/filesystem.hpp>
    3938
     
    4746#include "TclThreadManager.h"
    4847
    49 // Boost 1.36 has some issues with deprecated functions that have been omitted
    50 #if (BOOST_VERSION == 103600)
    51 #  define BOOST_LEAF_FUNCTION filename
    52 #  define BOOST_DICTIONARY_ENTRY_NAME string
    53 #elif (BOOST_FILESYSTEM_VERSION < 3)
    54 #  define BOOST_LEAF_FUNCTION leaf
    55 #  define BOOST_DICTIONARY_ENTRY_NAME string
     48// Differentiate Boost Filesystem v2 and v3
     49#if (BOOST_FILESYSTEM_VERSION < 3)
     50#  define BF_LEAF leaf
     51#  define BF_GENERIC_STRING string
     52#  define BF_DICTIONARY_ENTRY_NAME string
    5653#else
    57 #  define BOOST_LEAF_FUNCTION path().filename().string
    58 #  define BOOST_DICTIONARY_ENTRY_NAME path().string
     54#  define BF_LEAF path().filename().string
     55#  define BF_GENERIC_STRING generic_string
     56#  define BF_DICTIONARY_ENTRY_NAME path().string
    5957#endif
    6058
     
    250248                else
    251249                {
    252                     const std::string& dir = startdirectory.string();
     250                    const std::string& dir = startdirectory.BF_GENERIC_STRING();
    253251                    if (dir.size() > 0 && dir[dir.size() - 1] == ':')
    254252                        startdirectory = dir + '/';
     
    262260                {
    263261                    if (boost::filesystem::is_directory(*file))
    264                         dirlist.push_back(ArgumentCompletionListElement(file->BOOST_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BOOST_DICTIONARY_ENTRY_NAME()) + '/', file->BOOST_LEAF_FUNCTION() + '/'));
     262                        dirlist.push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BF_DICTIONARY_ENTRY_NAME()) + '/', file->BF_LEAF() + '/'));
    265263                    else
    266                         filelist.push_back(ArgumentCompletionListElement(file->BOOST_DICTIONARY_ENTRY_NAME(), getLowercase(file->BOOST_DICTIONARY_ENTRY_NAME()), file->BOOST_LEAF_FUNCTION()));
     264                        filelist.push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME(), getLowercase(file->BF_DICTIONARY_ENTRY_NAME()), file->BF_LEAF()));
    267265                    ++file;
    268266                }
Note: See TracChangeset for help on using the changeset viewer.