projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement hint cursor for resizable columns
[wxWidgets.git]
/
include
/
wx
/
cmdargs.h
diff --git
a/include/wx/cmdargs.h
b/include/wx/cmdargs.h
index e3dbd16a3683ca554966fc8a12a1c836f2469a00..a120c45870fd7cc6e6be3d22bda227398c09ffd4 100644
(file)
--- a/
include/wx/cmdargs.h
+++ b/
include/wx/cmdargs.h
@@
-26,7
+26,7
@@
// as it's used for compatibility, it tries to look as much as traditional
// (char **) argv as possible, in particular it provides implicit conversions
// to "char **" and also array-like operator[]
// as it's used for compatibility, it tries to look as much as traditional
// (char **) argv as possible, in particular it provides implicit conversions
// to "char **" and also array-like operator[]
-class wxCmdLineArgsArray
+class
WXDLLIMPEXP_BASE
wxCmdLineArgsArray
{
public:
wxCmdLineArgsArray() { m_argsA = NULL; m_argsW = NULL; }
{
public:
wxCmdLineArgsArray() { m_argsA = NULL; m_argsW = NULL; }
@@
-80,6
+80,12
@@
public:
return !m_args.empty();
}
return !m_args.empty();
}
+ // and the same for "if ( !argv )" checks
+ bool operator!() const
+ {
+ return m_args.empty();
+ }
+
wxString operator[](size_t n) const
{
return m_args[n];
wxString operator[](size_t n) const
{
return m_args[n];
@@
-92,9
+98,13
@@
public:
return m_args[n];
}
return m_args[n];
}
- // this is the only method of this class which doesn't exist solely for
- // compatibility purposes: it allows to access the arguments as a
- // convenient array of wxStrings
+
+ // convenience methods, i.e. not existing only for backwards compatibility
+
+ // do we have any arguments at all?
+ bool IsEmpty() const { return m_args.empty(); }
+
+ // access the arguments as a convenient array of wxStrings
const wxArrayString& GetArguments() const { return m_args; }
~wxCmdLineArgsArray()
const wxArrayString& GetArguments() const { return m_args; }
~wxCmdLineArgsArray()
@@
-129,6
+139,13
@@
private:
DECLARE_NO_COPY_CLASS(wxCmdLineArgsArray)
};
DECLARE_NO_COPY_CLASS(wxCmdLineArgsArray)
};
+// provide global operator overload for compatibility with the existing code
+// doing things like "if ( condition && argv )"
+inline bool operator&&(bool cond, const wxCmdLineArgsArray& array)
+{
+ return cond && !array.IsEmpty();
+}
+
#endif // wxUSE_UNICODE
#endif // _WX_CMDARGS_H_
#endif // wxUSE_UNICODE
#endif // _WX_CMDARGS_H_