summaryrefslogtreecommitdiff
path: root/indra/newview/llexternaleditor.h
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-03-25 14:11:27 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-03-25 14:11:27 -0700
commitc7906b34fd637d02b638a1cf587be2b413d79243 (patch)
tree3e709f30fa3c21f34a8fe3d24b364c86062bd6b9 /indra/newview/llexternaleditor.h
parent3528753a3a5e2f569872c49cdf6154833f483245 (diff)
parent44774cd265306c6d29f0a63c0876c7fa7b84311e (diff)
Merge
Diffstat (limited to 'indra/newview/llexternaleditor.h')
-rw-r--r--indra/newview/llexternaleditor.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/indra/newview/llexternaleditor.h b/indra/newview/llexternaleditor.h
index 6ea210d5e2..ef5db56c6e 100644
--- a/indra/newview/llexternaleditor.h
+++ b/indra/newview/llexternaleditor.h
@@ -42,6 +42,14 @@ class LLExternalEditor
public:
+ typedef enum e_error_code {
+ EC_SUCCESS, /// No error.
+ EC_NOT_SPECIFIED, /// Editor path not specified.
+ EC_PARSE_ERROR, /// Editor command parsing error.
+ EC_BINARY_NOT_FOUND, /// Could find the editor binary (missing or not quoted).
+ EC_FAILED_TO_RUN, /// Could not execute the editor binary.
+ } EErrorCode;
+
/**
* Set editor command.
*
@@ -51,19 +59,25 @@ public:
* First tries the override, then a predefined setting (sSetting),
* then the environment variable.
*
- * @return Command if found, empty string otherwise.
+ * @return EC_SUCCESS if command is valid and refers to an existing executable,
+ * EC_NOT_SPECIFIED or EC_FAILED_TO_RUNan on error.
*
* @see sSetting
*/
- bool setCommand(const std::string& env_var, const std::string& override = LLStringUtil::null);
+ EErrorCode setCommand(const std::string& env_var, const std::string& override = LLStringUtil::null);
/**
* Run the editor with the given file.
*
* @param file_path File to edit.
- * @return true on success, false on error.
+ * @return EC_SUCCESS on success, error code on error.
+ */
+ EErrorCode run(const std::string& file_path);
+
+ /**
+ * Get a meaningful error message for the given status code.
*/
- bool run(const std::string& file_path);
+ static std::string getErrorMessage(EErrorCode code);
private: