Skip to content

Commit

Permalink
do not install files if they are not downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Mar 5, 2024
2 parents 4a8b1c0 + d7a5e59 commit ae66853
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cmake_minimum_required(VERSION 3.16)
# set the project name
project(
libcifpp
VERSION 7.0.0
VERSION 7.0.1
LANGUAGES CXX)

list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 7.0.1
- Various reconstruction fixes
- category order in output fixed

Version 7.0.0
- Renaming many methods and parameters to be more
consistent with the mmCIF dictionaries.
Expand Down
2 changes: 1 addition & 1 deletion src/pdb/reconstruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void checkAtomAnisotropRecords(datablock &db)
{
if (cif::VERBOSE and std::exchange(warnReplaceTypeSymbol, false))
std::clog << "Replacing type_symbol in atom_site_anisotrop record(s)\n";
row["type_symbol"] != parent["type_symbol"].text();
row["type_symbol"] = parent["type_symbol"].text();
}

if (row["pdbx_auth_alt_id"].empty())
Expand Down
39 changes: 29 additions & 10 deletions src/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,41 @@ std::string trim_left_copy(std::string_view s)

void trim_left(std::string &s)
{
auto b = s.begin();
while (b != s.end())
auto in = s.begin(), out = s.begin();

while (in != s.end() and std::isspace(*in))
++in;

if (in == s.end())
s.clear();
else if (in != out)
{
if (not std::isspace(*b))
break;

b = std::next(b);
while (in != s.end())
*out++ = *in++;
s.erase(out, s.end());
}

s.erase(s.begin(), b);
}

void trim(std::string &s)
{
trim_right(s);
trim_left(s);
auto in = s.begin(), out = s.begin(), end = s.end();

while (end != s.begin() and std::isspace(*(end - 1)))
--end;

while (in != end and std::isspace(*in))
++in;

if (in == end)
s.clear();
else if (in != out)
{
while (in != end)
*out++ = *in++;
s.erase(out, s.end());
}
else if (end != s.end())
s.erase(end, s.end());
}

std::string trim_copy(std::string_view s)
Expand Down

0 comments on commit ae66853

Please sign in to comment.