summaryrefslogtreecommitdiff
path: root/testing/fx_string_testhelpers.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-06-23 11:48:57 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-23 18:14:20 +0000
commit5c3e5c13b9fc0285c47493eca1f9363a218d12a8 (patch)
tree6b2c49fef520b642243b03951ef27e25a6887793 /testing/fx_string_testhelpers.cpp
parent879b6d246341becaf572782ff1908b024543a01b (diff)
downloadpdfium-5c3e5c13b9fc0285c47493eca1f9363a218d12a8.tar.xz
Cleaning up fx_string_testhelpers.
This is unused except for being a pathway for indirect deps. Change-Id: I717290235ccbc59429ad24231033382958e2a086 Reviewed-on: https://pdfium-review.googlesource.com/6910 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'testing/fx_string_testhelpers.cpp')
-rw-r--r--testing/fx_string_testhelpers.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/testing/fx_string_testhelpers.cpp b/testing/fx_string_testhelpers.cpp
deleted file mode 100644
index 00a13f5b57..0000000000
--- a/testing/fx_string_testhelpers.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 PDFium 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 "testing/fx_string_testhelpers.h"
-
-#include <iomanip>
-#include <ios>
-#include <string>
-
-namespace {
-
-template <typename T>
-std::ostream& output_string(std::ostream& out, const T& str) {
- out << std::hex << std::setfill('0') << '"';
- // This function is used for FX strings whose length is defined as int.
- for (int i = 0; i < str.GetLength(); ++i) {
- unsigned int c = str.GetAt(i);
- if (c >= 0x20 && c < 0x7F) {
- out << static_cast<char>(c);
- } else if (sizeof(typename T::CharType) == 1) {
- out << "\\x" << std::setw(2) << c << std::setw(0);
- } else if (c < 0x10000) {
- out << "\\u" << std::setw(4) << c << std::setw(0);
- } else {
- out << "<invalid>";
- }
- }
- out << '"' << std::dec << std::setfill(' ');
- return out;
-}
-
-} // namespace
-
-std::ostream& operator<<(std::ostream& out, const CFX_ByteStringC& str) {
- return output_string(out, str);
-}
-
-std::ostream& operator<<(std::ostream& out, const CFX_ByteString& str) {
- return output_string(out, str);
-}
-
-std::ostream& operator<<(std::ostream& out, const CFX_WideStringC& str) {
- return output_string(out, str);
-}
-
-std::ostream& operator<<(std::ostream& out, const CFX_WideString& str) {
- return output_string(out, str);
-}
-
-std::ostream& operator<<(std::ostream& os, const CFX_DateTime& dt) {
- os << dt.GetYear() << "-" << std::to_string(dt.GetMonth()) << "-"
- << std::to_string(dt.GetDay()) << " " << std::to_string(dt.GetHour())
- << ":" << std::to_string(dt.GetMinute()) << ":"
- << std::to_string(dt.GetSecond()) << "."
- << std::to_string(dt.GetMillisecond());
- return os;
-}