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

Unified Diff: third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.cpp

Issue 1839753005: Move state machines to state_machines subdir (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix style errr Created 4 years, 9 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 | « third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.cpp
diff --git a/third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.cpp b/third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b36160bb7a76b02eb85ecae3f3a0ba324adf6ce7
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.cpp
@@ -0,0 +1,24 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/editing/state_machines/TextSegmentationMachineState.h"
+
+#include "wtf/Assertions.h"
+#include <ostream> // NOLINT
+
+namespace blink {
+
+std::ostream& operator<<(std::ostream& os, TextSegmentationMachineState state)
+{
+ static const char* const texts[] = {
+ "Invalid", "NeedMoreCodeUnit", "NeedFollowingCodeUnit", "Finished",
+ };
+
+ const auto& it = std::begin(texts) + static_cast<size_t>(state);
+ DCHECK_GE(it, std::begin(texts)) << "Unknown state value";
+ DCHECK_LT(it, std::end(texts)) << "Unknown state value";
+ return os << *it;
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698