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
1abf31ff
Unverified
Commit
1abf31ff
authored
Jan 05, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no-validate option in cif::Row::assign
parent
aec60829
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
17 deletions
+14
-17
include/cif++/Cif++.hpp
+2
-2
src/Cif++.cpp
+4
-4
src/Structure.cpp
+8
-11
No files found.
include/cif++/Cif++.hpp
View file @
1abf31ff
...
@@ -792,7 +792,7 @@ class Row
...
@@ -792,7 +792,7 @@ class Row
}
}
void
assign
(
const
std
::
vector
<
Item
>
&
values
);
void
assign
(
const
std
::
vector
<
Item
>
&
values
);
void
assign
(
std
::
string_view
name
,
const
std
::
string
&
value
,
bool
updateLinked
);
void
assign
(
std
::
string_view
name
,
const
std
::
string
&
value
,
bool
updateLinked
,
bool
validate
=
true
);
bool
operator
==
(
const
Row
&
rhs
)
const
bool
operator
==
(
const
Row
&
rhs
)
const
{
{
...
@@ -814,7 +814,7 @@ class Row
...
@@ -814,7 +814,7 @@ class Row
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Row
&
row
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Row
&
row
);
private
:
private
:
void
assign
(
size_t
column
,
const
std
::
string
&
value
,
bool
updateLinked
);
void
assign
(
size_t
column
,
const
std
::
string
&
value
,
bool
updateLinked
,
bool
validate
=
true
);
void
assign
(
const
Item
&
i
,
bool
updateLinked
);
void
assign
(
const
Item
&
i
,
bool
updateLinked
);
static
void
swap
(
size_t
column
,
ItemRow
*
a
,
ItemRow
*
b
);
static
void
swap
(
size_t
column
,
ItemRow
*
a
,
ItemRow
*
b
);
...
...
src/Cif++.cpp
View file @
1abf31ff
...
@@ -3009,12 +3009,12 @@ void Row::assign(const Item &value, bool skipUpdateLinked)
...
@@ -3009,12 +3009,12 @@ void Row::assign(const Item &value, bool skipUpdateLinked)
assign
(
value
.
name
(),
value
.
value
(),
skipUpdateLinked
);
assign
(
value
.
name
(),
value
.
value
(),
skipUpdateLinked
);
}
}
void
Row
::
assign
(
std
::
string_view
name
,
const
std
::
string
&
value
,
bool
skipUpdateLinked
)
void
Row
::
assign
(
std
::
string_view
name
,
const
std
::
string
&
value
,
bool
skipUpdateLinked
,
bool
validate
)
{
{
try
try
{
{
auto
cat
=
mData
->
mCategory
;
auto
cat
=
mData
->
mCategory
;
assign
(
cat
->
addColumn
(
name
),
value
,
skipUpdateLinked
);
assign
(
cat
->
addColumn
(
name
),
value
,
skipUpdateLinked
,
validate
);
}
}
catch
(
const
std
::
exception
&
ex
)
catch
(
const
std
::
exception
&
ex
)
{
{
...
@@ -3024,7 +3024,7 @@ void Row::assign(std::string_view name, const std::string &value, bool skipUpdat
...
@@ -3024,7 +3024,7 @@ void Row::assign(std::string_view name, const std::string &value, bool skipUpdat
}
}
}
}
void
Row
::
assign
(
size_t
column
,
const
std
::
string
&
value
,
bool
skipUpdateLinked
)
void
Row
::
assign
(
size_t
column
,
const
std
::
string
&
value
,
bool
skipUpdateLinked
,
bool
validate
)
{
{
if
(
mData
==
nullptr
)
if
(
mData
==
nullptr
)
throw
std
::
logic_error
(
"invalid Row, no data assigning value '"
+
value
+
"' to column with index "
+
std
::
to_string
(
column
));
throw
std
::
logic_error
(
"invalid Row, no data assigning value '"
+
value
+
"' to column with index "
+
std
::
to_string
(
column
));
...
@@ -3050,7 +3050,7 @@ void Row::assign(size_t column, const std::string &value, bool skipUpdateLinked)
...
@@ -3050,7 +3050,7 @@ void Row::assign(size_t column, const std::string &value, bool skipUpdateLinked)
std
::
string
oldStrValue
=
oldValue
?
oldValue
:
""
;
std
::
string
oldStrValue
=
oldValue
?
oldValue
:
""
;
// check the value
// check the value
if
(
col
.
mValidator
)
if
(
col
.
mValidator
and
validate
)
(
*
col
.
mValidator
)(
value
);
(
*
col
.
mValidator
)(
value
);
// If the field is part of the Key for this Category, remove it from the index
// If the field is part of the Key for this Category, remove it from the index
...
...
src/Structure.cpp
View file @
1abf31ff
...
@@ -109,7 +109,7 @@ void FileImpl::load_data(const char *data, size_t length)
...
@@ -109,7 +109,7 @@ void FileImpl::load_data(const char *data, size_t length)
// if (mData.getValidator() == nullptr)
// if (mData.getValidator() == nullptr)
mData
.
loadDictionary
(
"mmcif_pdbx_v50"
);
mData
.
loadDictionary
(
"mmcif_pdbx_v50"
);
if
(
not
mData
.
isValid
()
and
cif
::
VERBOSE
>=
0
)
if
(
not
mData
.
isValid
()
and
cif
::
VERBOSE
>=
0
)
std
::
cerr
<<
"Invalid mmCIF file"
<<
(
cif
::
VERBOSE
?
"."
:
" use --verbose option to see errors"
)
<<
std
::
endl
;
std
::
cerr
<<
"Invalid mmCIF file"
<<
(
cif
::
VERBOSE
>
0
?
"."
:
" use --verbose option to see errors"
)
<<
std
::
endl
;
}
}
void
FileImpl
::
load
(
const
std
::
filesystem
::
path
&
path
)
void
FileImpl
::
load
(
const
std
::
filesystem
::
path
&
path
)
...
@@ -181,7 +181,7 @@ void FileImpl::load(const std::filesystem::path &path)
...
@@ -181,7 +181,7 @@ void FileImpl::load(const std::filesystem::path &path)
// if (mData.getValidator() == nullptr)
// if (mData.getValidator() == nullptr)
mData
.
loadDictionary
(
"mmcif_pdbx_v50"
);
mData
.
loadDictionary
(
"mmcif_pdbx_v50"
);
if
(
not
mData
.
isValid
()
and
cif
::
VERBOSE
>=
0
)
if
(
not
mData
.
isValid
()
and
cif
::
VERBOSE
>=
0
)
std
::
cerr
<<
"Invalid mmCIF file"
<<
(
cif
::
VERBOSE
?
"."
:
" use --verbose option to see errors"
)
<<
std
::
endl
;
std
::
cerr
<<
"Invalid mmCIF file"
<<
(
cif
::
VERBOSE
>
0
?
"."
:
" use --verbose option to see errors"
)
<<
std
::
endl
;
}
}
void
FileImpl
::
save
(
const
std
::
filesystem
::
path
&
path
)
void
FileImpl
::
save
(
const
std
::
filesystem
::
path
&
path
)
...
@@ -295,17 +295,14 @@ void Atom::AtomImpl::moveTo(const Point &p)
...
@@ -295,17 +295,14 @@ void Atom::AtomImpl::moveTo(const Point &p)
if
(
not
mClone
)
if
(
not
mClone
)
{
{
set_property
(
"Cartn_x"
,
std
::
to_string
(
p
.
getX
()));
// set_property("Cartn_x", std::to_string(p.getX()));
set_property
(
"Cartn_y"
,
std
::
to_string
(
p
.
getY
()));
// set_property("Cartn_y", std::to_string(p.getY()));
set_property
(
"Cartn_z"
,
std
::
to_string
(
p
.
getZ
()));
// set_property("Cartn_z", std::to_string(p.getZ()));
mRow
.
assign
(
"Cartn_x"
,
std
::
to_string
(
p
.
getX
()),
true
);
mRow
.
assign
(
"Cartn_y"
,
std
::
to_string
(
p
.
getY
()),
true
);
mRow
.
assign
(
"Cartn_z"
,
std
::
to_string
(
p
.
getZ
()),
true
);
}
}
// boost::format kPosFmt("%.3f");
//
// mRow["Cartn_x"] = (kPosFmt % p.getX()).str();
// mRow["Cartn_y"] = (kPosFmt % p.getY()).str();
// mRow["Cartn_z"] = (kPosFmt % p.getZ()).str();
mLocation
=
p
;
mLocation
=
p
;
}
}
...
...
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