Skip to content

Commit

Permalink
Converted ShellAnything classes to use String class instead of std::s…
Browse files Browse the repository at this point in the history
…tring. For #102.
  • Loading branch information
end2endzone committed Jan 1, 2022
1 parent 2792c81 commit e381d08
Show file tree
Hide file tree
Showing 42 changed files with 552 additions and 524 deletions.
6 changes: 3 additions & 3 deletions include/shellanything/ActionClipboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ namespace shellanything
/// <summary>
/// Getter for the 'value' parameter.
/// </summary>
const std::string & GetValue() const;
const String & GetValue() const;

/// <summary>
/// Setter for the 'value' parameter.
/// </summary>
void SetValue(const std::string & value);
void SetValue(const String & value);

private:
std::string mValue;
String mValue;
};

} //namespace shellanything
Expand Down
24 changes: 12 additions & 12 deletions include/shellanything/ActionExecute.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,42 @@ namespace shellanything
/// <summary>
/// Getter for the 'path' parameter.
/// </summary>
const std::string & GetPath() const;
const String & GetPath() const;

/// <summary>
/// Setter for the 'path' parameter.
/// </summary>
void SetPath(const std::string & path);
void SetPath(const String & path);

/// <summary>
/// Getter for the 'basedir' parameter.
/// </summary>
const std::string & GetBaseDir() const;
const String & GetBaseDir() const;

/// <summary>
/// Setter for the 'basedir' parameter.
/// </summary>
void SetBaseDir(const std::string & base_dir);
void SetBaseDir(const String & base_dir);

/// <summary>
/// Getter for the 'arguments' parameter.
/// </summary>
const std::string & GetArguments() const;
const String & GetArguments() const;

/// <summary>
/// Setter for the 'arguments' parameter.
/// </summary>
void SetArguments(const std::string & arguments);
void SetArguments(const String & arguments);

/// <summary>
/// Getter for the 'verb' parameter.
/// </summary>
const std::string& GetVerb() const;
const String& GetVerb() const;

/// <summary>
/// Setter for the 'verb' parameter.
/// </summary>
void SetVerb(const std::string& verb);
void SetVerb(const String& verb);

private:
/// <summary>
Expand All @@ -104,10 +104,10 @@ namespace shellanything
virtual bool ExecuteProcess(const Context & context) const;

private:
std::string mPath;
std::string mBaseDir;
std::string mArguments;
std::string mVerb;
String mPath;
String mBaseDir;
String mArguments;
String mVerb;
};

} //namespace shellanything
Expand Down
18 changes: 9 additions & 9 deletions include/shellanything/ActionFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,37 @@ namespace shellanything
/// <summary>
/// Getter for the 'path' parameter.
/// </summary>
const std::string & GetPath() const;
const String & GetPath() const;

/// <summary>
/// Setter for the 'path' parameter.
/// </summary>
void SetPath(const std::string & path);
void SetPath(const String & path);

/// <summary>
/// Getter for the 'content' parameter.
/// </summary>
const std::string & GetText() const;
const String & GetText() const;

/// <summary>
/// Setter for the 'content' parameter.
/// </summary>
void SetText(const std::string & text);
void SetText(const String & text);

/// <summary>
/// Getter for the 'encoding' parameter.
/// </summary>
const std::string & GetEncoding() const;
const String & GetEncoding() const;

/// <summary>
/// Setter for the 'encoding' parameter.
/// </summary>
void SetEncoding(const std::string & encoding);
void SetEncoding(const String & encoding);

private:
std::string mPath;
std::string mText;
std::string mEncoding;
String mPath;
String mText;
String mEncoding;
};

} //namespace shellanything
Expand Down
18 changes: 9 additions & 9 deletions include/shellanything/ActionMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,37 @@ namespace shellanything
/// <summary>
/// Getter for the 'title' parameter.
/// </summary>
const std::string & GetTitle() const;
const String & GetTitle() const;

/// <summary>
/// Setter for the 'title' parameter.
/// </summary>
void SetTitle(const std::string & title);
void SetTitle(const String & title);

/// <summary>
/// Getter for the 'caption' parameter.
/// </summary>
const std::string & GetCaption() const;
const String & GetCaption() const;

/// <summary>
/// Setter for the 'caption' parameter.
/// </summary>
void SetCaption(const std::string & caption);
void SetCaption(const String & caption);

/// <summary>
/// Getter for the 'icon' parameter.
/// </summary>
const std::string & GetIcon() const;
const String & GetIcon() const;

/// <summary>
/// Setter for the 'icon' parameter.
/// </summary>
void SetIcon(const std::string & icon);
void SetIcon(const String & icon);

private:
std::string mTitle;
std::string mCaption;
std::string mIcon;
String mTitle;
String mCaption;
String mIcon;
};

} //namespace shellanything
Expand Down
6 changes: 3 additions & 3 deletions include/shellanything/ActionOpen.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ namespace shellanything
/// <summary>
/// Getter for the 'path' parameter.
/// </summary>
const std::string & GetPath() const;
const String & GetPath() const;

/// <summary>
/// Setter for the 'path' parameter.
/// </summary>
void SetPath(const std::string & path);
void SetPath(const String & path);

private:
std::string mPath;
String mPath;
};

} //namespace shellanything
Expand Down
36 changes: 18 additions & 18 deletions include/shellanything/ActionPrompt.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,70 +61,70 @@ namespace shellanything
/// <summary>
/// Getter for the 'name' parameter.
/// </summary>
const std::string & GetName() const;
const String & GetName() const;

/// <summary>
/// Setter for the 'name' parameter.
/// </summary>
void SetName(const std::string & name);
void SetName(const String & name);

/// <summary>
/// Getter for the 'type' parameter.
/// </summary>
const std::string & GetType() const;
const String & GetType() const;

/// <summary>
/// Setter for the 'type' parameter.
/// </summary>
void SetType(const std::string & type);
void SetType(const String & type);

/// <summary>
/// Getter for the 'title' parameter.
/// </summary>
const std::string & GetTitle() const;
const String & GetTitle() const;

/// <summary>
/// Setter for the 'title' parameter.
/// </summary>
void SetTitle(const std::string & title);
void SetTitle(const String & title);

/// <summary>
/// Getter for the 'default' parameter.
/// </summary>
const std::string & GetDefault() const;
const String & GetDefault() const;

/// <summary>
/// Setter for the 'default' parameter.
/// </summary>
void SetDefault(const std::string & default_value);
void SetDefault(const String & default_value);

/// <summary>
/// Getter for the 'valueyes' parameter.
/// </summary>
const std::string & GetValueYes() const;
const String & GetValueYes() const;

/// <summary>
/// Setter for the 'valueyes' parameter.
/// </summary>
void SetValueYes(const std::string & value_yes);
void SetValueYes(const String & value_yes);

/// <summary>
/// Getter for the 'valueno' parameter.
/// </summary>
const std::string & GetValueNo() const;
const String & GetValueNo() const;

/// <summary>
/// Setter for the 'valueno' parameter.
/// </summary>
void SetValueNo(const std::string & value_no);
void SetValueNo(const String & value_no);

private:
std::string mType;
std::string mName;
std::string mTitle;
std::string mDefault;
std::string mValueYes;
std::string mValueNo;
String mType;
String mName;
String mTitle;
String mDefault;
String mValueYes;
String mValueNo;
};

} //namespace shellanything
Expand Down
18 changes: 9 additions & 9 deletions include/shellanything/ActionProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,37 @@ namespace shellanything
/// <summary>
/// Getter for the 'name' parameter.
/// </summary>
const std::string & GetName() const;
const String & GetName() const;

/// <summary>
/// Setter for the 'name' parameter.
/// </summary>
void SetName(const std::string & name);
void SetName(const String & name);

/// <summary>
/// Getter for the 'value' parameter.
/// </summary>
const std::string & GetValue() const;
const String & GetValue() const;

/// <summary>
/// Setter for the 'value' parameter.
/// </summary>
void SetValue(const std::string & value);
void SetValue(const String & value);

/// <summary>
/// Getter for the 'exprtk' parameter.
/// </summary>
const std::string & GetExprtk() const;
const String & GetExprtk() const;

/// <summary>
/// Setter for the 'exprtk' parameter.
/// </summary>
void SetExprtk(const std::string & exprtk);
void SetExprtk(const String & exprtk);

private:
std::string mName;
std::string mValue;
std::string mExprtk;
String mName;
String mValue;
String mExprtk;
};


Expand Down
6 changes: 3 additions & 3 deletions include/shellanything/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace shellanything
/// <summary>
/// A list of string for holding configuration paths.
/// </summary>
typedef std::vector<std::string> PathList;
typedef std::vector<String> PathList;

static ConfigManager & GetInstance();

Expand All @@ -64,7 +64,7 @@ namespace shellanything
/// </summary>
/// <param name="path">The path of a Configuration file</param>
/// <returns>Returns true if the given path is a Configuration loaded by the manager. Returns false otherwise.</returns>
bool IsConfigFileLoaded(const std::string & path) const;
bool IsConfigFileLoaded(const String & path) const;

/// <summary>
/// Clears the configuration manager of all loaded Configuration
Expand Down Expand Up @@ -107,7 +107,7 @@ namespace shellanything
/// Add a new search path to the path list.
/// </summary>
/// <param name="path">The path to add to the search list.</param>
void AddSearchPath(const std::string & path);
void AddSearchPath(const String & path);

private:
//methods
Expand Down
10 changes: 5 additions & 5 deletions include/shellanything/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,24 @@ namespace shellanything
/// <param name="path">The file path to load</param>
/// <param name="error">The error desription if the file cannot be loaded.</param>
/// <returns>Returns a valid Configuration pointer if the file can be loaded. Returns NULL otherwise.</returns>
static Configuration * LoadFile(const std::string & path, std::string & error);
static Configuration * LoadFile(const String & path, String & error);

/// <summary>
/// Detect if a given file is a valid configuration file.
/// </summary>
/// <param name="path">The file path to load</param>
/// <returns>Returns true if the file is a valid configuration file. Returns false otherwise.</returns>
static bool IsValidConfigFile(const std::string & path);
static bool IsValidConfigFile(const String & path);

/// <summary>
/// Returns the file path of this configuration.
/// </summary>
const std::string & GetFilePath() const;
const String & GetFilePath() const;

/// <summary>
/// Set the file path of this configuration.
/// </summary>
void SetFilePath(const std::string & file_path);
void SetFilePath(const String & file_path);

/// <summary>
/// Returns the configuration file's modified date.
Expand Down Expand Up @@ -132,7 +132,7 @@ namespace shellanything
private:
DefaultSettings * mDefaults;
uint64_t mFileModifiedDate;
std::string mFilePath;
String mFilePath;
MenuPtrList mMenus;
};

Expand Down
Loading

0 comments on commit e381d08

Please sign in to comment.