We don't use boost::filesystem anymore.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24909 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-23 12:07:29 +00:00
parent 2e1cd6b575
commit 4113872d60
12 changed files with 1 additions and 1878 deletions

View File

@ -25,11 +25,6 @@ liblyxboost_la_SOURCES = \
else
liblyxboost_la_SOURCES = \
\
libs/filesystem/src/exception.cpp \
libs/filesystem/src/operations.cpp \
libs/filesystem/src/path.cpp \
libs/filesystem/src/portability.cpp \
\
libs/regex/src/c_regex_traits.cpp \
libs/regex/src/cpp_regex_traits.cpp \

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="libboost_filesystem"
ProjectGUID="{684579F5-D732-45CE-BBFB-9419BB98DADC}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\.."
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="TRUE"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="FALSE"
TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/libboost_filesystem-vc71-mt-gd-1_32.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\.."
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/libboost_filesystem-vc71-mt-1_32.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\src\convenience.cpp">
</File>
<File
RelativePath=".\src\exception.cpp">
</File>
<File
RelativePath=".\src\operations_posix_windows.cpp">
</File>
<File
RelativePath=".\src\path_posix_windows.cpp">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,166 +0,0 @@
// Exception implementation file -------------------------------------------//
// Copyright 2002 Beman Dawes
// Copyright 2001 Dietmar Kuehl
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
// at http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
// define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
// the library is being built (possibly exporting rather than importing code)
#define BOOST_FILESYSTEM_SOURCE
#include <boost/filesystem/config.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/cerrno.hpp>
namespace fs = boost::filesystem;
#include <cstring> // SGI MIPSpro compilers need this
# ifdef BOOST_NO_STDC_NAMESPACE
namespace std { using ::strerror; }
# endif
# if defined( BOOST_WINDOWS_API )
# include "windows.h"
# endif
//----------------------------------------------------------------------------//
namespace
{
#ifdef BOOST_WINDOWS_API
struct ec_xlate { fs::system_error_type sys_ec; fs::errno_type ec; };
const ec_xlate ec_table[] =
{
// see WinError.h comments for descriptions of errors
// most common errors first to speed sequential search
{ ERROR_FILE_NOT_FOUND, ENOENT },
{ ERROR_PATH_NOT_FOUND, ENOENT },
// alphabetical for easy maintenance
{ 0, 0 }, // no error
{ ERROR_ACCESS_DENIED, EACCES },
{ ERROR_ALREADY_EXISTS, EEXIST },
{ ERROR_BAD_UNIT, ENODEV },
{ ERROR_BUFFER_OVERFLOW, ENAMETOOLONG },
{ ERROR_BUSY, EBUSY },
{ ERROR_BUSY_DRIVE, EBUSY },
{ ERROR_CANNOT_MAKE, EACCES },
{ ERROR_CANTOPEN, EIO },
{ ERROR_CANTREAD, EIO },
{ ERROR_CANTWRITE, EIO },
{ ERROR_CURRENT_DIRECTORY, EACCES },
{ ERROR_DEV_NOT_EXIST, ENODEV },
{ ERROR_DEVICE_IN_USE, EBUSY },
{ ERROR_DIR_NOT_EMPTY, ENOTEMPTY },
{ ERROR_DIRECTORY, EINVAL }, // WinError.h: "The directory name is invalid"
{ ERROR_DISK_FULL, ENOSPC },
{ ERROR_FILE_EXISTS, EEXIST },
{ ERROR_HANDLE_DISK_FULL, ENOSPC },
{ ERROR_INVALID_ACCESS, EACCES },
{ ERROR_INVALID_DRIVE, ENODEV },
{ ERROR_INVALID_FUNCTION, ENOSYS },
{ ERROR_INVALID_HANDLE, EBADHANDLE },
{ ERROR_INVALID_NAME, EINVAL },
{ ERROR_LOCK_VIOLATION, EACCES },
{ ERROR_LOCKED, EACCES },
{ ERROR_NOACCESS, EACCES },
{ ERROR_NOT_ENOUGH_MEMORY, ENOMEM },
{ ERROR_NOT_READY, EAGAIN },
{ ERROR_NOT_SAME_DEVICE, EXDEV },
{ ERROR_OPEN_FAILED, EIO },
{ ERROR_OPEN_FILES, EBUSY },
{ ERROR_OUTOFMEMORY, ENOMEM },
{ ERROR_READ_FAULT, EIO },
{ ERROR_SEEK, EIO },
{ ERROR_SHARING_VIOLATION, EACCES },
{ ERROR_TOO_MANY_OPEN_FILES, ENFILE },
{ ERROR_WRITE_FAULT, EIO },
{ ERROR_WRITE_PROTECT, EROFS },
{ 0,EOTHER }
};
#endif
} // unnamed namespace
namespace boost
{
namespace filesystem
{
# ifdef BOOST_WINDOWS_API
BOOST_FILESYSTEM_DECL
errno_type lookup_errno( system_error_type sys_err_code )
{
for ( const ec_xlate * cur = &ec_table[0];
cur != ec_table
+ sizeof(ec_table)/sizeof(ec_xlate); ++cur )
{
if ( sys_err_code == cur->sys_ec ) return cur->ec;
}
return EOTHER;
}
BOOST_FILESYSTEM_DECL void
system_message( system_error_type sys_err_code, std::string & target )
{
LPVOID lpMsgBuf;
::FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
sys_err_code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPSTR) &lpMsgBuf,
0,
NULL
);
target += static_cast<LPCSTR>(lpMsgBuf);
::LocalFree( lpMsgBuf ); // free the buffer
while ( target.size()
&& (target[target.size()-1] == '\n' || target[target.size()-1] == '\r') )
target.erase( target.size()-1 );
}
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
BOOST_FILESYSTEM_DECL void
system_message( system_error_type sys_err_code, std::wstring & target )
{
LPVOID lpMsgBuf;
::FormatMessageW(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
sys_err_code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPWSTR) &lpMsgBuf,
0,
NULL
);
target += static_cast<LPCWSTR>(lpMsgBuf);
::LocalFree( lpMsgBuf ); // free the buffer
while ( target.size()
&& (target[target.size()-1] == L'\n' || target[target.size()-1] == L'\r') )
target.erase( target.size()-1 );
}
# endif
# else
void
system_message( system_error_type sys_err_code, std::string & target )
{
target += std::strerror( sys_err_code );
}
# endif
} // namespace filesystem
} // namespace boost

File diff suppressed because it is too large Load Diff

View File

@ -1,121 +0,0 @@
// path.cpp ----------------------------------------------------------------//
// Copyright 2005 Beman Dawes
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
// at http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
// define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
// the library is being built (possibly exporting rather than importing code)
#define BOOST_FILESYSTEM_SOURCE
#include <boost/filesystem/config.hpp>
#ifndef BOOST_FILESYSTEM_NARROW_ONLY
#include <boost/filesystem/path.hpp>
#include <boost/scoped_array.hpp>
#include <locale>
#include <cerrno>
namespace
{
// std::locale construction can throw (if LC_MESSAGES is wrong, for example),
// so a static at function scope is used to ensure that exceptions can be
// caught. (A previous version was at namespace scope, so initialization
// occurred before main(), preventing exceptions from being caught.)
std::locale & loc()
{
// ISO C calls this "the locale-specific native environment":
static std::locale lc("");
return lc;
}
const std::codecvt<wchar_t, char, std::mbstate_t> *&
converter()
{
static const std::codecvt<wchar_t, char, std::mbstate_t> *
cvtr(
&std::use_facet<std::codecvt<wchar_t, char, std::mbstate_t> >
( loc() ) );
return cvtr;
}
bool locked(false);
} // unnamed namespace
namespace boost
{
namespace filesystem
{
bool wpath_traits::imbue( const std::locale & new_loc, const std::nothrow_t & )
{
if ( locked ) return false;
locked = true;
loc() = new_loc;
converter() = &std::use_facet
<std::codecvt<wchar_t, char, std::mbstate_t> >( loc() );
return true;
}
void wpath_traits::imbue( const std::locale & new_loc )
{
if ( locked ) boost::throw_exception( filesystem_wpath_error(
"boost::filesystem::wpath_traits::imbue() after lockdown", 0 ) );
imbue( new_loc, std::nothrow );
}
# ifdef BOOST_POSIX_API
// Because this is POSIX only code, we don't have to worry about ABI issues
// described in http://www.boost.org/more/separate_compilation.html
wpath_traits::external_string_type
wpath_traits::to_external( const wpath & ph,
const internal_string_type & src )
{
locked = true;
std::size_t work_size( converter()->max_length() * (src.size()+1) );
boost::scoped_array<char> work( new char[ work_size ] );
std::mbstate_t state;
const internal_string_type::value_type * from_next;
external_string_type::value_type * to_next;
if ( converter()->out(
state, src.c_str(), src.c_str()+src.size(), from_next, work.get(),
work.get()+work_size, to_next ) != std::codecvt_base::ok )
boost::throw_exception( boost::filesystem::filesystem_wpath_error(
"boost::filesystem::wpath::to_external conversion error",
ph, EINVAL ) );
*to_next = '\0';
return external_string_type( work.get() );
}
wpath_traits::internal_string_type
wpath_traits::to_internal( const external_string_type & src )
{
locked = true;
std::size_t work_size( src.size()+1 );
boost::scoped_array<wchar_t> work( new wchar_t[ work_size ] );
std::mbstate_t state;
const external_string_type::value_type * from_next;
internal_string_type::value_type * to_next;
if ( converter()->in(
state, src.c_str(), src.c_str()+src.size(), from_next, work.get(),
work.get()+work_size, to_next ) != std::codecvt_base::ok )
boost::throw_exception( boost::filesystem::filesystem_wpath_error(
"boost::filesystem::wpath::to_internal conversion error", EINVAL ) );
*to_next = L'\0';
return internal_string_type( work.get() );
}
# endif // BOOST_POSIX_API
} // namespace filesystem
} // namespace boost
#endif // ifndef BOOST_FILESYSTEM_NARROW_ONLY

View File

@ -1,112 +0,0 @@
// portability.cpp ---------------------------------------------------------//
// Copyright © 2002-2005 Beman Dawes
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
// at http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
// define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
// the library is being built (possibly exporting rather than importing code)
#define BOOST_FILESYSTEM_SOURCE
#include <boost/filesystem/config.hpp>
#include <boost/filesystem/path.hpp>
namespace fs = boost::filesystem;
#include <cstring> // SGI MIPSpro compilers need this
# ifdef BOOST_NO_STDC_NAMESPACE
namespace std { using ::strerror; }
# endif
//----------------------------------------------------------------------------//
namespace
{
const char invalid_chars[] =
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
"<>:\"/\\|";
// note that the terminating '\0' is part of the string - thus the size below
// is sizeof(invalid_chars) rather than sizeof(invalid_chars)-1. I
const std::string windows_invalid_chars( invalid_chars, sizeof(invalid_chars) );
const std::string valid_posix(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-" );
} // unnamed namespace
namespace boost
{
namespace filesystem
{
// name_check functions ----------------------------------------------//
# ifdef BOOST_WINDOWS
BOOST_FILESYSTEM_DECL bool native( const std::string & name )
{
return windows_name( name );
}
# else
BOOST_FILESYSTEM_DECL bool native( const std::string & name )
{
return name.find('/') == std::string::npos;
}
# endif
BOOST_FILESYSTEM_DECL bool portable_posix_name( const std::string & name )
{
return name.size() != 0
&& name.find_first_not_of( valid_posix ) == std::string::npos;
}
BOOST_FILESYSTEM_DECL bool windows_name( const std::string & name )
{
return name.size() != 0
&& name.find_first_of( windows_invalid_chars ) == std::string::npos
&& *(name.end()-1) != ' '
&& (*(name.end()-1) != '.'
|| name.length() == 1 || name == "..");
}
BOOST_FILESYSTEM_DECL bool portable_name( const std::string & name )
{
return
name.size() == 0
|| name == "."
|| name == ".."
|| (windows_name( name )
&& portable_posix_name( name )
&& name[0] != '.' && name[0] != '-');
}
BOOST_FILESYSTEM_DECL bool portable_directory_name( const std::string & name )
{
return
name == "."
|| name == ".."
|| (portable_name( name )
&& name.find('.') == std::string::npos);
}
BOOST_FILESYSTEM_DECL bool portable_file_name( const std::string & name )
{
std::string::size_type pos;
return
name == "."
|| name == ".."
|| (portable_name( name )
&& ( (pos = name.find( '.' )) == std::string::npos
|| (name.find( '.', pos+1 )== std::string::npos
&& (pos + 5) > name.length() )))
;
}
} // namespace filesystem
} // namespace boost

View File

@ -1,8 +1,3 @@
#include "libs/filesystem/src/exception.cpp"
#include "libs/filesystem/src/operations.cpp"
#include "libs/filesystem/src/path.cpp"
#include "libs/filesystem/src/portability.cpp"
//#include "libs/regex/src/cpp_regex_traits.cpp"
//#include "libs/regex/src/c_regex_traits.cpp"
#include "libs/regex/src/cregex.cpp"

View File

@ -1,10 +1,5 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/filesystem/config.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/scoped_array.hpp>
#include <boost/signals/connection.hpp>
#include <boost/signals/detail/signal_base.hpp>

View File

@ -6,8 +6,6 @@
project(boost)
#add_subdirectory(filesystem)
#add_subdirectory(iostreams)
add_subdirectory(regex)
add_subdirectory(signals)

View File

@ -1,24 +0,0 @@
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
#
# Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
#
project(boost_filesystem)
set(boost_filesystem_sources
exception.cpp
operations.cpp
path.cpp
portability.cpp)
lyx_add_path(boost_filesystem_sources ${TOP_SRC_DIR}/boost/libs/filesystem/src)
if(NOT MERGE_FILES)
add_library(boost_filesystem STATIC ${boost_filesystem_sources})
else()
add_definitions(-D_WIN32_WINNT=0x500)
lyx_const_touched_files(_allinone boost_filesystem_sources)
add_library(boost_filesystem STATIC ${_allinone_files})
endif()

View File

@ -615,7 +615,7 @@ if conf.CheckLib('nsl'):
# check available boost libs (since lyx1.4 does not use iostream)
boost_libs = []
for lib in ['signals', 'regex', 'filesystem']:
for lib in ['signals', 'regex']:
if os.path.isdir(os.path.join(top_src_dir, 'boost', 'libs', lib)):
boost_libs.append(lib)

View File

@ -2779,25 +2779,6 @@ boost_libs_regex_src_extra_files = Split('''
''')
boost_libs_filesystem_extra_files = Split('''
Makefile.am
filesystem.vcproj
''')
boost_libs_filesystem_src_files = Split('''
exception.cpp
operations.cpp
path.cpp
portability.cpp
''')
boost_libs_filesystem_src_extra_files = Split('''
Makefile.am
pch.h
''')
development_Win32_packaging_installer = Split('''
license.rtf