CBuild
C++ build system with scripts written in c++
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
CBuild::Hash Class Referenceabstract

#include <hasher.hpp>

Inheritance diagram for CBuild::Hash:
CBuild::CBuildHash CBuild::CBuildHashV2 CBuild::GCCHash

Public Member Functions

 Hash (std::string target_id)
 
virtual lib::map< std::string, std::string > get_files_for_recompilation (std::vector< std::string > file_list, std::vector< std::string > objects_list)=0
 Pass a list of source files and coresponding object files and get a map of source-object that need to be recompiled (check only hash and dependencie hash, not any arg canges)
 
virtual int compare_and_set_cargs (std::vector< std::string > cargs)=0
 Compare compile args and update metadata.
 
virtual int compare_and_set_largs (std::vector< std::string > largs)=0
 Compare link args and update metadata.
 
virtual int compare_and_set_commands (std::string compiler, std::string linker, std::string packer)=0
 Compare shell commands used for compilation and update metadata.
 
virtual int compare_and_set_output_file (std::string out)=0
 Compare output file name and update metadata.
 
virtual void set_target_meta (std::vector< std::string > cargs, std::vector< std::string > largs, std::string out, std::string compiler, std::string linker, std::string packer)=0
 Set the target meta.
 

Protected Attributes

std::string target_id
 

Detailed Description

Definition at line 62 of file hasher.hpp.

Constructor & Destructor Documentation

◆ Hash()

CBuild::Hash::Hash ( std::string target_id)
inline

Definition at line 67 of file hasher.hpp.

References target_id.

Member Function Documentation

◆ compare_and_set_cargs()

virtual int CBuild::Hash::compare_and_set_cargs ( std::vector< std::string > cargs)
pure virtual

Compare compile args and update metadata.

Parameters
cargs=> std::vector<std::string> -> Compile args
Returns
int -> 0 - all good, 1 - args didnt match, -1 - File didnt exist at all

Implemented in CBuild::CBuildHashV2, CBuild::GCCHash, and CBuild::CBuildHash.

◆ compare_and_set_commands()

virtual int CBuild::Hash::compare_and_set_commands ( std::string compiler,
std::string linker,
std::string packer )
pure virtual

Compare shell commands used for compilation and update metadata.

Parameters
compiler=> std::string -> Command used for compiling source files
linker=> std::string -> Command used for linking objects
packer=> std::string -> Command used for packing static libs
Returns
int -> 0 - all good, 1 - args didnt match, -1 - File didnt exist at all

Implemented in CBuild::CBuildHashV2, CBuild::GCCHash, and CBuild::CBuildHash.

◆ compare_and_set_largs()

virtual int CBuild::Hash::compare_and_set_largs ( std::vector< std::string > largs)
pure virtual

Compare link args and update metadata.

Parameters
cargs=> std::vector<std::string> -> Compile args
Returns
int -> 0 - all good, 1 - args didnt match, -1 - File didnt exist at all

Implemented in CBuild::CBuildHashV2, CBuild::GCCHash, and CBuild::CBuildHash.

◆ compare_and_set_output_file()

virtual int CBuild::Hash::compare_and_set_output_file ( std::string out)
pure virtual

Compare output file name and update metadata.

Parameters
out=> std::string -> Output name
Returns
int -> 0 - all good, 1 - args didnt match, -1 - File didnt exist at all

Implemented in CBuild::CBuildHashV2, CBuild::GCCHash, and CBuild::CBuildHash.

◆ get_files_for_recompilation()

virtual lib::map< std::string, std::string > CBuild::Hash::get_files_for_recompilation ( std::vector< std::string > file_list,
std::vector< std::string > objects_list )
pure virtual

Pass a list of source files and coresponding object files and get a map of source-object that need to be recompiled (check only hash and dependencie hash, not any arg canges)

Parameters
file_list=> std::vector<std::string> -> List of source files
objects_list=> std::vector<std::string> -> List of object files
Returns
lib::map<std::string, std::string> -> Map of source->object, that need to be recompiled

Implemented in CBuild::CBuildHashV2, CBuild::GCCHash, and CBuild::CBuildHash.

◆ set_target_meta()

virtual void CBuild::Hash::set_target_meta ( std::vector< std::string > cargs,
std::vector< std::string > largs,
std::string out,
std::string compiler,
std::string linker,
std::string packer )
pure virtual

Set the target meta.

Parameters
cargs=> std::vector<std::string> -> Compile args
largs=> std::vector<std::string> -> Link args
out=> std::string -> Output binary name
compiler=> std::string -> Command used for compiling source files
linker=> std::string -> Command used for linking objects
packer=> std::string -> Command used for packing static libs

Implemented in CBuild::CBuildHashV2, CBuild::GCCHash, and CBuild::CBuildHash.

Member Data Documentation

◆ target_id

std::string CBuild::Hash::target_id
protected

The documentation for this class was generated from the following file: