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
6946c406
Unverified
Commit
6946c406
authored
Oct 30, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'trunk' of github.com:PDB-REDO/libcifpp into trunk
parents
bd3723ee
3c62a386
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletions
+36
-1
include/cif++/pdb/io.hpp
+18
-1
src/pdb/cif2pdb.cpp
+18
-0
No files found.
include/cif++/pdb/io.hpp
View file @
6946c406
...
...
@@ -31,14 +31,30 @@
namespace
cif
::
pdb
{
file
read
(
std
::
istream
&
is
);
/// \brief Read a file in either mmCIF or PDB format, compressed or not,
/// depending on the content.
file
read
(
const
std
::
filesystem
::
path
&
file
);
/// \brief Read a file in either mmCIF or PDB format, compressed or not,
/// depending on the content.
file
read
(
std
::
istream
&
is
);
/// \brief Write out a file in PDB format
void
write
(
std
::
ostream
&
os
,
const
datablock
&
db
);
/// \brief Write out a file in PDB format
inline
void
write
(
std
::
ostream
&
os
,
const
file
&
f
)
{
write
(
os
,
f
.
front
());
}
/// \brief Write out a file in PDB format or mmCIF format, depending on the filename extension
void
write
(
const
std
::
filesystem
::
path
&
file
,
const
datablock
&
db
);
/// \brief Write out a file in PDB format or mmCIF format, depending on the filename extension
inline
void
write
(
const
std
::
filesystem
::
path
&
p
,
const
file
&
f
)
{
write
(
p
,
f
.
front
());
}
}
\ No newline at end of file
src/pdb/cif2pdb.cpp
View file @
6946c406
...
...
@@ -30,6 +30,7 @@
#include <regex>
#include <set>
#include <gxrio.hpp>
#include <cif++.hpp>
#include <cif++/pdb/cif2pdb.hpp>
...
...
@@ -3723,4 +3724,21 @@ void write(std::ostream &os, const datablock &db)
<<
"END"
<<
std
::
endl
;
}
void
write
(
const
std
::
filesystem
::
path
&
p
,
const
datablock
&
db
)
{
gxrio
::
ofstream
out
(
p
);
bool
writePDB
=
false
;
if
(
p
.
extension
()
==
".gz"
)
writePDB
=
iequals
(
p
.
stem
().
extension
().
string
(),
".pdb"
);
else
writePDB
=
iequals
(
p
.
extension
().
string
(),
".pdb"
);
if
(
writePDB
)
write
(
out
,
db
);
else
db
.
write
(
out
);
}
}
// namespace cif::pdb
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