mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
renaming
This commit is contained in:
parent
aadd59d005
commit
4171ab4bbd
3 changed files with 39 additions and 9 deletions
|
@ -39,13 +39,40 @@ class NixCode {
|
|||
class ErrorInfo {
|
||||
public:
|
||||
ErrLevel level;
|
||||
string errName;
|
||||
string name;
|
||||
string description;
|
||||
string toolName;
|
||||
string program;
|
||||
optional<NixCode> nixCode;
|
||||
string hint;
|
||||
ErrorInfo& GetEI() { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class AddName : private T
|
||||
{
|
||||
public:
|
||||
T& name(const std::string &name){
|
||||
GetEI().name = name;
|
||||
return *this;
|
||||
}
|
||||
protected:
|
||||
ErrorInfo& GetEI() { return T::GetEI(); }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class AddDescription : private T
|
||||
{
|
||||
public:
|
||||
T& description(const std::string &description){
|
||||
GetEI().description = description;
|
||||
return *this;
|
||||
}
|
||||
protected:
|
||||
ErrorInfo& GetEI() { return T::GetEI(); }
|
||||
};
|
||||
|
||||
typedef AddName<AddDescription<ErrorInfo>> StandardError;
|
||||
|
||||
string showErrLine(ErrLine &errLine);
|
||||
|
||||
void print_code_lines(string &prefix, NixCode &nix_code);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue