CASM  1.1.0
A Clusters Approach to Statistical Mechanics
APICommand.cc
Go to the documentation of this file.
1 #include "casm/app/APICommand.hh"
2 
4 #include "casm/clex/PrimClex.hh"
5 
6 namespace CASM {
7 
9  : m_args(_args), m_in_project(!find_casmroot(_args.root).empty()) {}
10 
11 const CommandArgs &APICommandBase::args() const { return m_args; }
12 
13 fs::path APICommandBase::root() const { return m_args.root; }
14 
15 bool APICommandBase::in_project() const { return m_in_project; }
16 
18  if (m_args.primclex) {
19  return *m_args.primclex;
20  } else if (!m_primclex) {
21  m_primclex.reset(new PrimClex(root()));
22  }
23  return *m_primclex;
24 }
25 } // namespace CASM
const CommandArgs & args() const
Definition: APICommand.cc:11
const CommandArgs & m_args
Definition: APICommand.hh:41
std::unique_ptr< PrimClex > m_primclex
Definition: APICommand.hh:43
PrimClex & primclex() const
Definition: APICommand.cc:17
bool in_project() const
Definition: APICommand.cc:15
APICommandBase(const CommandArgs &_args)
Definition: APICommand.cc:8
fs::path root() const
Definition: APICommand.cc:13
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:55
Main CASM namespace.
Definition: APICommand.hh:8
fs::path find_casmroot(const fs::path &cwd)
Data structure holding basic CASM command info.