Skip to content

Commit df95618

Browse files
committed
Added constructor.
1 parent 02b3f17 commit df95618

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/Essentials/Definitions/Fonction.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,24 @@ namespace FPL {
3030
bool operator==(FonctionArgumentDef const& arg1, FonctionArgumentDef const& arg2) {
3131
return arg1.ArgumentName == arg2.ArgumentName;
3232
}
33+
34+
bool operator==(const FonctionDef &v1, const FonctionDef &v2) {
35+
return v1.FonctionName == v2.FonctionName;
36+
}
37+
38+
bool operator!=(const FonctionDef &v1, const FonctionDef &v2) {
39+
return v1.FonctionName != v2.FonctionName;
40+
}
41+
42+
FonctionDef::FonctionDef(std::string name, Types::Types type, std::map<std::string, FonctionArgumentDef> allArgs,
43+
std::vector<std::string> code, int nArgs, std::string returnV) {
44+
this->FonctionName = name;
45+
this->FonctionType = type;
46+
this->AllFonctionArguments = allArgs;
47+
this->FonctionContentCode = code;
48+
this->FonctionNumberArgument = nArgs;
49+
this->ReturnValue = returnV;
50+
}
51+
52+
FonctionDef::FonctionDef() {}
3353
}

src/Essentials/Definitions/Fonction.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ namespace FPL {
2424

2525
class FonctionDef {
2626
public:
27+
FonctionDef();
28+
FonctionDef(std::string name, Types::Types type, std::map<std::string, FonctionArgumentDef> allArgs, std::vector<std::string> code, int nArgs, std::string returnV);
29+
2730
std::string FonctionName;
2831
Types::Types FonctionType;
2932
std::map<std::string, FonctionArgumentDef> AllFonctionArguments;
@@ -32,6 +35,8 @@ namespace FPL {
3235
std::string ReturnValue = "N/A";
3336

3437
friend std::ostream& operator<<(std::ostream& flux, FonctionDef const& var);
38+
friend bool operator==(const FonctionDef &v1, const FonctionDef &v2);
39+
friend bool operator!=(const FonctionDef &v1, const FonctionDef &v2);
3540

3641
bool isArgument(std::string const& argument);
3742
std::optional<FonctionArgumentDef> getArgument(std::string const& argument);

0 commit comments

Comments
 (0)