top | up | prev | next

Project Class

Definition at line 137 of Project.hpp

Constructors

Project(const Project&) delete
Project(const std::u32string& name_, const std::string& filePath_, const std::string& config_, BackEnd backend_, const std::string& toolChain_, SystemDirKind systemDirKind)

Member Functions

void AddDeclaration(ProjectDeclaration* declaration)
void AddDependsOnId(const std::string& dependsOnId)
void AddDependsOnProjects(Project* dependsOnProject)
void AddResourceFileName(const std::string& resourceFileName, const std::string& resourceFilePath)
void AddSourceFileName(const std::string& sourceFileName, const std::string& sourceFilePath)
void AddTextFileName(const std::string& textFileName, const std::string& textFilePath)
bool Built()
bool DependsOn(Project* that) const
const std::vector<std::string>& DependsOnIds() const
const std::vector<Project*>& DependsOnProjects()
const std::string& ExecutableFilePath() const
const std::string& FilePath() const
Target GetTarget() const
bool HasResourceFile(const std::string& resourceFilePath) const
bool HasSourceFile(const std::string& sourceFilePath) const
bool HasTextFile(const std::string& textFilePath) const
const std::string& Hash() const
std::string Id() const
int Index() const
bool IsSystemProject() const
bool IsUpToDate(const std::string& systemModuleFilePath) const
const std::string& LibraryFilePath() const
int LogStreamId() const
const std::string& ModuleFilePath() const
const std::u32string& Name() const
const boost::filesystem::path& OutdirBasePath() const
bool Ready()
const std::vector<std::string>& ReferencedProjectFilePaths() const
const std::vector<std::string>& References() const
const std::string& RelativeFilePath() const
const std::vector<std::string>& RelativeReferencedProjectFilePaths() const
const std::vector<std::string>& RelativeResourceFilePaths() const
const std::vector<std::string>& RelativeSourceFilePaths() const
const std::vector<std::string>& RelativeTextFilePaths() const
void RemoveFile(const std::string& filePath, const std::string& fileName)
void ResolveDeclarations()
const std::vector<std::string>& ResourceFilePaths() const
void Save()
void SetBuilt()
void SetExcludeSourceFilePath(const std::string& excludeSourceFilePath_)
void SetHash(const std::string& hash_)
void SetIndex(int index_)
void SetLibraryFilePath(const std::string& libraryFilePath_)
void SetLogStreamId(int logStreamId_)
void SetModuleFilePath(const std::string& moduleFilePath_)
void SetReferencedProjects(const std::vector<Project*>& referencedProjects)
void SetRelativeFilePath(const std::string& relativeFilePath_)
void SetSystemProject()
void SetTarget(Target target_)
const boost::filesystem::path& SourceBasePath() const
const std::vector<std::string>& SourceFilePaths() const
const std::vector<std::string>& TextFilePaths() const
void Write(const std::string& projectFilePath)
Project& operator=(const Project&) delete

Member Variables

BackEnd backend
bool built
std::string config
std::vector<std::unique_ptr<ProjectDeclaration>> declarations
std::vector<Project*> dependsOn
std::vector<std::string> dependsOnIds
std::string excludeSourceFilePath
std::string executableFilePath
std::string filePath
std::string hash
int index
bool isSystemProject
std::string libraryFilePath
int logStreamId
std::string moduleFilePath
std::mutex mtx
std::u32string name
boost::filesystem::path outdirBasePath
std::vector<std::string> referencedProjectFilePaths
std::vector<std::string> references
std::string relativeFilePath
std::vector<std::string> relativeReferencedProjectFilePaths
std::vector<std::string> relativeResourceFilePaths
std::vector<std::string> relativeSourceFilePaths
std::vector<std::string> relativeTextFilePaths
std::vector<std::string> resourceFilePaths
boost::filesystem::path sourceBasePath
std::vector<std::string> sourceFilePaths
boost::filesystem::path systemLibDir
Target target
std::vector<std::string> textFilePaths
std::string toolChain

Constructor Details

Project Constructor

sngcm::ast::Project::Project(const Project &) delete

Definition at line 142 of Project.hpp


Project Constructor

sngcm::ast::Project::Project(const std::u32string& name_, const std::string& filePath_, const std::string& config_, BackEnd backend_, const std::string& toolChain_, SystemDirKind systemDirKind)

Definition at line 291 of Project.cpp
Declaration at line 140 of Project.hpp


Member Function Details

AddDeclaration Member Function

void sngcm::ast::Project::AddDeclaration(ProjectDeclaration * declaration)

Definition at line 395 of Project.cpp :
396 {
397     declarations.push_back(std::unique_ptr<ProjectDeclaration>(declaration));
398 }


Declaration at line 148 of Project.hpp


AddDependsOnId Member Function

void sngcm::ast::Project::AddDependsOnId(const std::string& dependsOnId)

Definition at line 658 of Project.cpp :
659 {
660     dependsOnIds.push_back(dependsOnId);
661 }


Declaration at line 187 of Project.hpp


AddDependsOnProjects Member Function

void sngcm::ast::Project::AddDependsOnProjects(Project * dependsOnProject)

Definition at line 558 of Project.cpp :
559 {
560     dependsOn.push_back(dependsOnProject);
561 }


Declaration at line 166 of Project.hpp


AddResourceFileName Member Function

void sngcm::ast::Project::AddResourceFileName(const std::string& resourceFileName, const std::string& resourceFilePath)

Definition at line 707 of Project.cpp :
708 {
709     relativeResourceFilePaths.push_back(resourceFileName);
710     std::sort(relativeResourceFilePaths.begin()relativeResourceFilePaths.end());
711     resourceFilePaths.push_back(resourceFilePath);
712     std::sort(resourceFilePaths.begin()resourceFilePaths.end());
713 }


Declaration at line 193 of Project.hpp


AddSourceFileName Member Function

void sngcm::ast::Project::AddSourceFileName(const std::string& sourceFileName, const std::string& sourceFilePath)

Definition at line 699 of Project.cpp :
700 {
701     relativeSourceFilePaths.push_back(sourceFileName);
702     std::sort(relativeSourceFilePaths.begin()relativeSourceFilePaths.end());
703     sourceFilePaths.push_back(sourceFilePath);
704     std::sort(sourceFilePaths.begin()sourceFilePaths.end());
705 }


Declaration at line 192 of Project.hpp


AddTextFileName Member Function

void sngcm::ast::Project::AddTextFileName(const std::string& textFileName, const std::string& textFilePath)

Definition at line 715 of Project.cpp :
716 {
717     relativeTextFilePaths.push_back(textFileName);
718     std::sort(relativeTextFilePaths.begin()relativeTextFilePaths.end());
719     textFilePaths.push_back(textFilePath);
720     std::sort(textFilePaths.begin()textFilePaths.end());
721 }


Declaration at line 194 of Project.hpp


Built Member Function

bool sngcm::ast::Project::Built()

Definition at line 624 of Project.cpp :
625 {
626     return built;
627 }


Declaration at line 180 of Project.hpp

Called by: sngcm::ast::Project::Ready


DependsOn Member Function

bool sngcm::ast::Project::DependsOn(Project * that) const

Definition at line 553 of Project.cpp :
554 {
555     return std::find(references.cbegin()references.cend()that->moduleFilePath) != references.cend();
556 }


Declaration at line 165 of Project.hpp


DependsOnIds Member Function

const std::vector<std::string>& sngcm::ast::Project::DependsOnIds() const

Definition at line 188 of Project.hpp :
188 { return dependsOnIds; }


DependsOnProjects Member Function

const std::vector<Project *>& sngcm::ast::Project::DependsOnProjects()

Definition at line 179 of Project.hpp :
179 { return dependsOn; }


ExecutableFilePath Member Function

const std::string& sngcm::ast::Project::ExecutableFilePath() const

Definition at line 153 of Project.hpp :
153 { return executableFilePath; }


FilePath Member Function

const std::string& sngcm::ast::Project::FilePath() const

Definition at line 145 of Project.hpp :
145 { return filePath; }

Called by: sngcm::ast::Project::SetReferencedProjects


GetTarget Member Function

Target sngcm::ast::Project::GetTarget() const

Definition at line 163 of Project.hpp :
163 { return target; }


HasResourceFile Member Function

bool sngcm::ast::Project::HasResourceFile(const std::string& resourceFilePath) const

Definition at line 675 of Project.cpp :
676 {
677     for (const auto& filePath : resourceFilePaths)
678     {
679         if (filePath == resourceFilePath)
680         {
681             return true;
682         }
683     }
684     return false;
685 }


Declaration at line 190 of Project.hpp


HasSourceFile Member Function

bool sngcm::ast::Project::HasSourceFile(const std::string& sourceFilePath) const

Definition at line 663 of Project.cpp :
664 {
665     for (const auto& filePath : sourceFilePaths)
666     {
667         if (filePath == sourceFilePath)
668         {
669             return true;
670         }
671     }
672     return false;
673 }


Declaration at line 189 of Project.hpp


HasTextFile Member Function

bool sngcm::ast::Project::HasTextFile(const std::string& textFilePath) const

Definition at line 687 of Project.cpp :
688 {
689     for (const auto& filePath : textFilePaths)
690     {
691         if (filePath == textFilePath)
692         {
693             return true;
694         }
695     }
696     return false;
697 }


Declaration at line 191 of Project.hpp


Hash Member Function

const std::string& sngcm::ast::Project::Hash() const

Definition at line 185 of Project.hpp :
185 { return hash; }


Id Member Function

std::string sngcm::ast::Project::Id() const

Definition at line 651 of Project.cpp :
652 {
653     std::string id = "project_";
654     id.append(ToUtf8(name)).append(1'_').append(GetSha1MessageDigest(filePath));
655     return id;
656 }


Declaration at line 186 of Project.hpp


Index Member Function

int sngcm::ast::Project::Index() const

Definition at line 178 of Project.hpp :
178 { return index; }


IsSystemProject Member Function

bool sngcm::ast::Project::IsSystemProject() const

Definition at line 167 of Project.hpp :
167 { return isSystemProject; }

Called by: sngcm::ast::Project::IsUpToDate


IsUpToDate Member Function

bool sngcm::ast::Project::IsUpToDate(const std::string& systemModuleFilePath) const

Definition at line 587 of Project.cpp
Declaration at line 174 of Project.hpp

Calls: sngcm::ast::Project::IsSystemProject


LibraryFilePath Member Function

const std::string& sngcm::ast::Project::LibraryFilePath() const

Definition at line 152 of Project.hpp :
152 { return libraryFilePath; }


LogStreamId Member Function

int sngcm::ast::Project::LogStreamId() const

Definition at line 175 of Project.hpp :
175 { return logStreamId; }


ModuleFilePath Member Function

const std::string& sngcm::ast::Project::ModuleFilePath() const

Definition at line 151 of Project.hpp :
151 { return moduleFilePath; }


Name Member Function

const std::u32string& sngcm::ast::Project::Name() const

Definition at line 144 of Project.hpp :
144 { return name; }

Called by: sngcm::ast::Project::Write , sngcm::ast::Solution::Save


OutdirBasePath Member Function

const boost::filesystem::path& sngcm::ast::Project::OutdirBasePath() const

Definition at line 147 of Project.hpp :
147 { return outdirBasePath; }


Ready Member Function

bool sngcm::ast::Project::Ready()

Definition at line 634 of Project.cpp :
635 {
636     for (Project* dependOn : dependsOn)
637     {
638         if (!dependOn->Built())
639         {
640             return false;
641         }
642     }
643     return true;
644 }


Declaration at line 182 of Project.hpp

Calls: sngcm::ast::Project::Built


ReferencedProjectFilePaths Member Function

const std::vector<std::string>& sngcm::ast::Project::ReferencedProjectFilePaths() const

Definition at line 155 of Project.hpp :
155 { return referencedProjectFilePaths; }


References Member Function

const std::vector<std::string>& sngcm::ast::Project::References() const

Definition at line 154 of Project.hpp :
154 { return references; }


RelativeFilePath Member Function

const std::string& sngcm::ast::Project::RelativeFilePath() const

Definition at line 170 of Project.hpp :
170 { return relativeFilePath; }


RelativeReferencedProjectFilePaths Member Function

const std::vector<std::string>& sngcm::ast::Project::RelativeReferencedProjectFilePaths() const

Definition at line 156 of Project.hpp :
156 { return relativeReferencedProjectFilePaths; }


RelativeResourceFilePaths Member Function

const std::vector<std::string>& sngcm::ast::Project::RelativeResourceFilePaths() const

Definition at line 160 of Project.hpp :
160 { return relativeResourceFilePaths; }


RelativeSourceFilePaths Member Function

const std::vector<std::string>& sngcm::ast::Project::RelativeSourceFilePaths() const

Definition at line 158 of Project.hpp :
158 { return relativeSourceFilePaths; }


RelativeTextFilePaths Member Function

const std::vector<std::string>& sngcm::ast::Project::RelativeTextFilePaths() const

Definition at line 161 of Project.hpp :
161 { return relativeTextFilePaths; }


RemoveFile Member Function

void sngcm::ast::Project::RemoveFile(const std::string& filePath, const std::string& fileName)

Definition at line 723 of Project.cpp :
724 {
725     relativeSourceFilePaths.erase(std::remove(relativeSourceFilePaths.begin()relativeSourceFilePaths.end()fileName)relativeSourceFilePaths.end());
726     sourceFilePaths.erase(std::remove(sourceFilePaths.begin()sourceFilePaths.end()filePath)sourceFilePaths.end());
727     relativeResourceFilePaths.erase(std::remove(relativeResourceFilePaths.begin()relativeResourceFilePaths.end()fileName)relativeResourceFilePaths.end());
728     resourceFilePaths.erase(std::remove(resourceFilePaths.begin()resourceFilePaths.end()filePath)resourceFilePaths.end());
729     relativeTextFilePaths.erase(std::remove(relativeTextFilePaths.begin()relativeTextFilePaths.end()fileName)relativeTextFilePaths.end());
730     textFilePaths.erase(std::remove(textFilePaths.begin()textFilePaths.end()filePath)textFilePaths.end());
731 }


Declaration at line 195 of Project.hpp


ResolveDeclarations Member Function

void sngcm::ast::Project::ResolveDeclarations()

Definition at line 400 of Project.cpp
Declaration at line 149 of Project.hpp

Calls: sngcm::ast::ReferenceDeclaration::FilePath , sngcm::ast::ResourceFileDeclaration::FilePath , sngcm::ast::SourceFileDeclaration::FilePath , sngcm::ast::TargetDeclaration::GetTarget , sngcm::ast::TextFileDeclaration::FilePath


ResourceFilePaths Member Function

const std::vector<std::string>& sngcm::ast::Project::ResourceFilePaths() const

Definition at line 159 of Project.hpp :
159 { return resourceFilePaths;  }


Save Member Function

void sngcm::ast::Project::Save()

Definition at line 733 of Project.cpp
Declaration at line 196 of Project.hpp

Calls: soulng::util::CodeFormatter::WriteLine


SetBuilt Member Function

void sngcm::ast::Project::SetBuilt()

Definition at line 629 of Project.cpp :
630 {
631     built = true;
632 }


Declaration at line 181 of Project.hpp


SetExcludeSourceFilePath Member Function

void sngcm::ast::Project::SetExcludeSourceFilePath(const std::string& excludeSourceFilePath_)

Definition at line 646 of Project.cpp :
647 {
648     excludeSourceFilePath = excludeSourceFilePath_;
649 }


Declaration at line 183 of Project.hpp


SetHash Member Function

void sngcm::ast::Project::SetHash(const std::string& hash_)

Definition at line 184 of Project.hpp :
184 { hash = hash_; }


SetIndex Member Function

void sngcm::ast::Project::SetIndex(int index_)

Definition at line 177 of Project.hpp :
177 { index = index_; }


SetLibraryFilePath Member Function

void sngcm::ast::Project::SetLibraryFilePath(const std::string& libraryFilePath_)

Definition at line 568 of Project.cpp :
569 {
570     libraryFilePath = libraryFilePath_;
571 }


Declaration at line 172 of Project.hpp


SetLogStreamId Member Function

void sngcm::ast::Project::SetLogStreamId(int logStreamId_)

Definition at line 176 of Project.hpp :
176 { logStreamId = logStreamId_; }


SetModuleFilePath Member Function

void sngcm::ast::Project::SetModuleFilePath(const std::string& moduleFilePath_)

Definition at line 563 of Project.cpp :
564 {
565     moduleFilePath = moduleFilePath_;
566 }


Declaration at line 171 of Project.hpp


SetReferencedProjects Member Function

void sngcm::ast::Project::SetReferencedProjects(const std::vector<Project *>& referencedProjects)

Definition at line 573 of Project.cpp
Declaration at line 173 of Project.hpp

Calls: sngcm::ast::Project::FilePath , soulng::util::Path::Combine , soulng::util::Path::GetDirectoryName , soulng::util::Path::GetFileName


SetRelativeFilePath Member Function

void sngcm::ast::Project::SetRelativeFilePath(const std::string& relativeFilePath_)

Definition at line 169 of Project.hpp :
169 { relativeFilePath = relativeFilePath_; }


SetSystemProject Member Function

void sngcm::ast::Project::SetSystemProject()

Definition at line 168 of Project.hpp :
168 { isSystemProject = true; }


SetTarget Member Function

void sngcm::ast::Project::SetTarget(Target target_)

Definition at line 164 of Project.hpp :
164 { target = target_; }


SourceBasePath Member Function

const boost::filesystem::path& sngcm::ast::Project::SourceBasePath() const

Definition at line 146 of Project.hpp :
146 { return sourceBasePath; }


SourceFilePaths Member Function

const std::vector<std::string>& sngcm::ast::Project::SourceFilePaths() const

Definition at line 157 of Project.hpp :
157 { return sourceFilePaths; }


TextFilePaths Member Function

const std::vector<std::string>& sngcm::ast::Project::TextFilePaths() const

Definition at line 162 of Project.hpp :
162 { return textFilePaths; }


Write Member Function

void sngcm::ast::Project::Write(const std::string& projectFilePath)

Definition at line 542 of Project.cpp :
543 {
544     std::ofstream projectFile(projectFilePath);
545     CodeFormatter formatter(projectFile);
546     formatter.WriteLine("project " + ToUtf8(Name()) + ";");
547     for (const std::std::unique_ptr<ProjectDeclaration>&declaration : declarations)
548     {
549         declaration->Write(formatter);
550     }
551 }


Declaration at line 150 of Project.hpp

Calls: sngcm::ast::Project::Name , soulng::util::CodeFormatter::WriteLine


operator= Member Function

Project & sngcm::ast::Project::operator=(const Project &) delete

Definition at line 143 of Project.hpp


top | up | prev | next