Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
4524357c
Commit
4524357c
authored
Sep 28, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zlib, again (use the zlib from boost in Windows)
parent
0b05b6f6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
38 deletions
+34
-38
.gitignore
+3
-2
CMakeLists.txt
+6
-4
include/cif++/Cif++.hpp
+3
-3
include/cif++/Compound.hpp
+2
-2
include/cif++/Structure.hpp
+3
-3
src/Cif++.cpp
+3
-3
src/Compound.cpp
+6
-6
src/Structure.cpp
+8
-15
No files found.
.gitignore
View file @
4524357c
...
...
@@ -9,4 +9,6 @@ test/rename-compound-test
tools/update-dictionary-script
data/
CMakeSettings.json
msvc/
\ No newline at end of file
msvc/
Testing/
CMakeLists.txt
View file @
4524357c
...
...
@@ -182,7 +182,9 @@ if(NOT BUILD_SHARED_LIBS)
endif
()
find_package
(
Boost 1.70.0 REQUIRED COMPONENTS system iostreams regex date_time program_options
)
find_package
(
ZLIB REQUIRED
)
if
(
NOT MSVC AND Boost_USE_STATIC_LIBS
)
find_package
(
ZLIB REQUIRED
)
endif
()
# Create a revision file, containing the current git version info
...
...
@@ -209,7 +211,7 @@ if(RECREATE_SYMOP_DATA)
add_executable
(
symop-map-generator
"
${
CMAKE_SOURCE_DIR
}
/tools/symop-map-generator.cpp"
)
target_link_libraries
(
symop-map-generator Threads::Threads
${
Boost_LIBRARIES
}
std::filesystem
ZLIB::ZLIB
)
target_link_libraries
(
symop-map-generator Threads::Threads
${
Boost_LIBRARIES
}
std::filesystem
${
ZLIB_LIBRARIES
}
)
if
(
Boost_INCLUDE_DIR
)
target_include_directories
(
symop-map-generator PUBLIC
${
Boost_INCLUDE_DIR
}
)
endif
()
...
...
@@ -282,7 +284,7 @@ target_include_directories(cifpp
${
CMAKE_BINARY_DIR
}
)
target_link_libraries
(
cifpp Threads::Threads
${
Boost_LIBRARIES
}
std::filesystem
ZLIB::ZLIB
)
target_link_libraries
(
cifpp Threads::Threads
${
Boost_LIBRARIES
}
std::filesystem
${
ZLIB_LIBRARIES
}
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
target_link_options
(
cifpp PRIVATE -undefined dynamic_lookup
)
...
...
@@ -446,7 +448,7 @@ if(CIFPP_BUILD_TESTS)
${
CMAKE_CURRENT_BINARY_DIR
}
# for config.h
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp
${
Boost_LIBRARIES
}
std::filesystem
ZLIB::ZLIB
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp
${
Boost_LIBRARIES
}
std::filesystem
${
ZLIB_LIBRARIES
}
)
if
(
MSVC
)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
...
...
include/cif++/Cif++.hpp
View file @
4524357c
...
...
@@ -2141,15 +2141,15 @@ class File
File
();
File
(
std
::
istream
&
is
,
bool
validate
=
false
);
File
(
const
std
::
string
&
path
,
bool
validate
=
false
);
File
(
const
std
::
filesystem
::
path
&
path
,
bool
validate
=
false
);
File
(
File
&&
rhs
);
File
(
const
File
&
rhs
)
=
delete
;
File
&
operator
=
(
const
File
&
rhs
)
=
delete
;
~
File
();
void
load
(
const
std
::
string
&
p
);
void
save
(
const
std
::
string
&
p
);
void
load
(
const
std
::
filesystem
::
path
&
p
);
void
save
(
const
std
::
filesystem
::
path
&
p
);
void
load
(
std
::
istream
&
is
);
void
save
(
std
::
ostream
&
os
);
...
...
include/cif++/Compound.hpp
View file @
4524357c
...
...
@@ -162,8 +162,8 @@ class CompoundFactory
static
CompoundFactory
&
instance
();
static
void
clear
();
void
setDefaultDictionary
(
const
std
::
string
&
inDictFile
);
void
pushDictionary
(
const
std
::
string
&
inDictFile
);
void
setDefaultDictionary
(
const
std
::
filesystem
::
path
&
inDictFile
);
void
pushDictionary
(
const
std
::
filesystem
::
path
&
inDictFile
);
void
popDictionary
();
bool
isKnownPeptide
(
const
std
::
string
&
res_name
)
const
;
...
...
include/cif++/Structure.hpp
View file @
4524357c
...
...
@@ -397,7 +397,7 @@ class File : public std::enable_shared_from_this<File>
{
public
:
File
();
File
(
const
std
::
string
&
path
);
File
(
const
std
::
filesystem
::
path
&
path
);
File
(
const
char
*
data
,
size_t
length
);
// good luck trying to find out what it is...
~
File
();
...
...
@@ -406,8 +406,8 @@ class File : public std::enable_shared_from_this<File>
cif
::
Datablock
&
createDatablock
(
const
std
::
string
&
name
);
void
load
(
const
std
::
string
&
path
);
void
save
(
const
std
::
string
&
path
);
void
load
(
const
std
::
filesystem
::
path
&
path
);
void
save
(
const
std
::
filesystem
::
path
&
path
);
Structure
*
model
(
size_t
nr
=
1
);
...
...
src/Cif++.cpp
View file @
4524357c
...
...
@@ -3399,7 +3399,7 @@ File::File(std::istream &is, bool validate)
load
(
is
);
}
File
::
File
(
const
std
::
string
&
path
,
bool
validate
)
File
::
File
(
const
std
::
filesystem
::
path
&
path
,
bool
validate
)
:
File
()
{
try
...
...
@@ -3452,7 +3452,7 @@ void File::append(Datablock *e)
}
}
void
File
::
load
(
const
std
::
string
&
p
)
void
File
::
load
(
const
std
::
filesystem
::
path
&
p
)
{
fs
::
path
path
(
p
);
...
...
@@ -3482,7 +3482,7 @@ void File::load(const std::string &p)
}
}
void
File
::
save
(
const
std
::
string
&
p
)
void
File
::
save
(
const
std
::
filesystem
::
path
&
p
)
{
fs
::
path
path
(
p
);
...
...
src/Compound.cpp
View file @
4524357c
...
...
@@ -268,7 +268,7 @@ class CompoundFactoryImpl : public std::enable_shared_from_this<CompoundFactoryI
public
:
CompoundFactoryImpl
(
std
::
shared_ptr
<
CompoundFactoryImpl
>
next
);
CompoundFactoryImpl
(
const
std
::
string
&
file
,
std
::
shared_ptr
<
CompoundFactoryImpl
>
next
);
CompoundFactoryImpl
(
const
std
::
filesystem
::
path
&
file
,
std
::
shared_ptr
<
CompoundFactoryImpl
>
next
);
virtual
~
CompoundFactoryImpl
()
{
...
...
@@ -362,7 +362,7 @@ CompoundFactoryImpl::CompoundFactoryImpl(std::shared_ptr<CompoundFactoryImpl> ne
mKnownBases
.
insert
(
key
);
}
CompoundFactoryImpl
::
CompoundFactoryImpl
(
const
std
::
string
&
file
,
std
::
shared_ptr
<
CompoundFactoryImpl
>
next
)
CompoundFactoryImpl
::
CompoundFactoryImpl
(
const
std
::
filesystem
::
path
&
file
,
std
::
shared_ptr
<
CompoundFactoryImpl
>
next
)
:
mNext
(
next
)
{
cif
::
File
cifFile
(
file
);
...
...
@@ -677,10 +677,10 @@ void CompoundFactory::clear()
sInstance
.
reset
();
}
void
CompoundFactory
::
setDefaultDictionary
(
const
std
::
string
&
inDictFile
)
void
CompoundFactory
::
setDefaultDictionary
(
const
std
::
filesystem
::
path
&
inDictFile
)
{
if
(
not
fs
::
exists
(
inDictFile
))
throw
std
::
runtime_error
(
"file not found: "
+
inDictFile
);
throw
std
::
runtime_error
(
"file not found: "
+
inDictFile
.
string
()
);
try
{
...
...
@@ -693,10 +693,10 @@ void CompoundFactory::setDefaultDictionary(const std::string &inDictFile)
}
}
void
CompoundFactory
::
pushDictionary
(
const
std
::
string
&
inDictFile
)
void
CompoundFactory
::
pushDictionary
(
const
std
::
filesystem
::
path
&
inDictFile
)
{
if
(
not
fs
::
exists
(
inDictFile
))
throw
std
::
runtime_error
(
"file not found: "
+
inDictFile
);
throw
std
::
runtime_error
(
"file not found: "
+
inDictFile
.
string
()
);
// ifstream file(inDictFile);
// if (not file.is_open())
...
...
src/Structure.cpp
View file @
4524357c
...
...
@@ -59,8 +59,8 @@ struct FileImpl
void
load_data
(
const
char
*
data
,
size_t
length
);
void
load
(
const
std
::
string
&
p
);
void
save
(
const
std
::
string
&
p
);
void
load
(
const
std
::
filesystem
::
path
&
path
);
void
save
(
const
std
::
filesystem
::
path
&
path
);
};
void
FileImpl
::
load_data
(
const
char
*
data
,
size_t
length
)
...
...
@@ -112,10 +112,8 @@ void FileImpl::load_data(const char *data, size_t length)
std
::
cerr
<<
"Invalid mmCIF file"
<<
(
cif
::
VERBOSE
?
"."
:
" use --verbose option to see errors"
)
<<
std
::
endl
;
}
void
FileImpl
::
load
(
const
std
::
string
&
p
)
void
FileImpl
::
load
(
const
std
::
filesystem
::
path
&
path
)
{
fs
::
path
path
(
p
);
std
::
ifstream
inFile
(
path
,
std
::
ios_base
::
in
|
std
::
ios_base
::
binary
);
if
(
not
inFile
.
is_open
())
throw
std
::
runtime_error
(
"No such file: "
+
path
.
string
());
...
...
@@ -185,18 +183,13 @@ void FileImpl::load(const std::string &p)
std
::
cerr
<<
"Invalid mmCIF file"
<<
(
cif
::
VERBOSE
?
"."
:
" use --verbose option to see errors"
)
<<
std
::
endl
;
}
void
FileImpl
::
save
(
const
std
::
string
&
p
)
void
FileImpl
::
save
(
const
std
::
filesystem
::
path
&
path
)
{
fs
::
path
path
(
p
);
std
::
ofstream
outFile
(
p
,
std
::
ios_base
::
out
|
std
::
ios_base
::
binary
);
std
::
ofstream
outFile
(
path
,
std
::
ios_base
::
out
|
std
::
ios_base
::
binary
);
io
::
filtering_stream
<
io
::
output
>
out
;
if
(
path
.
extension
()
==
".gz"
)
{
out
.
push
(
io
::
gzip_compressor
());
path
=
path
.
stem
();
}
out
.
push
(
outFile
);
...
...
@@ -1732,7 +1725,7 @@ File::File(const char *data, size_t length)
mImpl
->
load_data
(
data
,
length
);
}
File
::
File
(
const
std
::
string
&
File
)
File
::
File
(
const
std
::
filesystem
::
path
&
File
)
:
mImpl
(
new
FileImpl
)
{
load
(
File
);
...
...
@@ -1753,12 +1746,12 @@ cif::Datablock& File::createDatablock(const std::string &name)
return
*
mImpl
->
mDb
;
}
void
File
::
load
(
const
std
::
string
&
p
)
void
File
::
load
(
const
std
::
filesystem
::
path
&
p
)
{
mImpl
->
load
(
p
);
}
void
File
::
save
(
const
std
::
string
&
file
)
void
File
::
save
(
const
std
::
filesystem
::
path
&
file
)
{
mImpl
->
save
(
file
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment