Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: tools/tool_support.h

Issue 1120383003: Get generate_dump compiling on Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@tools
Patch Set: fix mac; no implicit conversion to std::string for StringPiece Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/generate_dump.cc ('k') | tools/tool_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tool_support.h
diff --git a/tools/tool_support.h b/tools/tool_support.h
index 47976bc9692c7f3ddb3f26ec0ef4f0c0c6db57bf..9099691a209e8551b9e9c08d95155379acc42e00 100644
--- a/tools/tool_support.h
+++ b/tools/tool_support.h
@@ -19,6 +19,7 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
+#include "base/strings/string_piece.h"
#include "build/build_config.h"
namespace crashpad {
@@ -53,6 +54,25 @@ class ToolSupport {
static void UsageHint(const std::string& me, const char* hint);
#endif // OS_POSIX
+#if defined(OS_WIN) || DOXYGEN
+ //! \brief Converts \a argv `wchar_t` UTF-16 to UTF-8, and passes onwards to a
+ //! UTF-8 entry point.
+ //!
+ //! \return The return value of \a entry.
+ static int Wmain(int argc, wchar_t* argv[], int (*entry)(int, char*[]));
+#endif // OS_WIN
+
+ //! \brief Converts a command line argument to the string type suitable for
+ //! base::FilePath.
+ //!
+ //! On POSIX, this is a no-op. On Windows, assumes that Wmain() was used, and
+ //! the input argument was converted from UTF-16 in a `wchar_t*` to UTF-8 in a
+ //! `char*`. This undoes that transformation.
+ //!
+ //! \sa Wmain()
+ static base::FilePath::StringType CommandLineArgumentToFilePathStringType(
+ const base::StringPiece& arg);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ToolSupport);
};
« no previous file with comments | « tools/generate_dump.cc ('k') | tools/tool_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698