| 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
|
|
|