Skip to content

Commit

Permalink
endl
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Apr 16, 2024
1 parent c0555b6 commit 6e30365
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char *argv[])

if (file.empty())
{
std::cerr << "Empty file" << std::endl;
std::cerr << "Empty file\n";
exit(1);
}

Expand All @@ -66,8 +66,8 @@ int main(int argc, char *argv[])
auto n = atom_site.count(cif::key("label_atom_id") == "OXT");

std::cout << "File contains " << atom_site.size() << " atoms of which "
<< n << (n == 1 ? " is" : " are") << " OXT" << std::endl
<< "residues with an OXT are:" << std::endl;
<< n << (n == 1 ? " is" : " are") << " OXT\n"
<< "residues with an OXT are:\n";

// Loop over all atoms with atom-id "OXT" and print out some info.
// That info is extracted using structured binding in C++
Expand All @@ -76,7 +76,7 @@ int main(int argc, char *argv[])
cif::key("label_atom_id") == "OXT",
"label_asym_id", "label_comp_id", "label_seq_id"))
{
std::cout << asym << ' ' << comp << ' ' << seqnr << std::endl;
std::cout << asym << ' ' << comp << ' ' << seqnr << '\n';
}

return 0;
Expand Down
28 changes: 14 additions & 14 deletions src/compound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ compound *compound_factory_impl::create(const std::string &id)
m_index = parser.index_datablocks();

if (cif::VERBOSE > 1)
std::cout << " done" << std::endl;
std::cout << " done\n";

// reload the resource, perhaps this should be improved...
if (m_file.empty())
Expand All @@ -519,7 +519,7 @@ compound *compound_factory_impl::create(const std::string &id)
parser.parse_single_datablock(id, m_index);

if (cif::VERBOSE > 1)
std::cout << " done" << std::endl;
std::cout << " done\n";

if (not file.empty())
{
Expand All @@ -545,20 +545,20 @@ class local_compound_factory_impl : public compound_factory_impl
: compound_factory_impl(next)
, m_local_file(file)
{
const std::regex peptideRx("(?:[lmp]-)?peptide", std::regex::icase);
// const std::regex peptideRx("(?:[lmp]-)?peptide", std::regex::icase);

for (const auto &[id, name, threeLetterCode, group] :
file["comp_list"]["chem_comp"].rows<std::string, std::string, std::string, std::string>("id", "name", "three_letter_code", "group"))
{
auto &rdb = m_local_file["comp_" + id];
if (rdb.empty())
{
std::cerr << "Missing data in restraint file for id " + id + '\n';
continue;
}
// for (const auto &[id, name, threeLetterCode, group] :
// file["comp_list"]["chem_comp"].rows<std::string, std::string, std::string, std::string>("id", "name", "three_letter_code", "group"))
// {
// auto &rdb = m_local_file["comp_" + id];
// if (rdb.empty())
// {
// // std::cerr << "Missing data in restraint file for id " + id + '\n';
// continue;
// }

construct_compound(rdb, id, name, threeLetterCode, group);
}
// construct_compound(rdb, id, name, threeLetterCode, group);
// }
}

compound *create(const std::string &id) override;
Expand Down
4 changes: 2 additions & 2 deletions src/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void progress_bar_impl::print_progress()
float progress = static_cast<float>(m_consumed) / m_max_value;

if (width < kMinBarWidth)
std::cout << (100 * progress) << '%' << std::endl;
std::cout << (100 * progress) << "%\n";
else
{
uint32_t bar_width = 7 * width / 10;
Expand Down Expand Up @@ -329,7 +329,7 @@ void progress_bar_impl::print_done()
if (msg.length() < width)
msg += std::string(width - msg.length(), ' ');

std::cout << '\r' << msg << std::endl;
std::cout << '\r' << msg << '\n';
}

progress_bar::progress_bar(int64_t inMax, const std::string &inAction)
Expand Down

0 comments on commit 6e30365

Please sign in to comment.