You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2019/07/29 13:58:13 UTC

[GitHub] [incubator-pagespeed-mod] jmarantz commented on a change in pull request #1935: [WIP] Bazel build system

jmarantz commented on a change in pull request #1935: [WIP] Bazel build system
URL: https://github.com/apache/incubator-pagespeed-mod/pull/1935#discussion_r308244205
 
 

 ##########
 File path: pagespeed/kernel/base/string_util.h
 ##########
 @@ -17,48 +17,182 @@
  * under the License.
  */
 
-
 #ifndef PAGESPEED_KERNEL_BASE_STRING_UTIL_H_
 #define PAGESPEED_KERNEL_BASE_STRING_UTIL_H_
 
-#include <cctype>                      // for isascii
+#include <cctype> // for isascii
 #include <cstddef>
 #include <map>
 #include <set>
 #include <vector>
 
-#include "base/logging.h"
+#include <iostream>
+
+#include "absl/strings/numbers.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+// XXX(oschaaf): internal util
+#include "absl/strings/internal/memutil.h"
+#include "absl/strings/match.h"
+
+//#include "base/logging.h"
 #include "pagespeed/kernel/base/basictypes.h"
 #include "pagespeed/kernel/base/string.h"
 
+#include "fmt/printf.h"
 
-#include <cstdlib>  // NOLINT
+#include <cstdlib> // NOLINT
 #include <string>  // NOLINT
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_piece.h"
-#include "base/strings/string_util.h"
-#include "base/strings/stringprintf.h"
 
-using base::StringAppendF;
-using base::StringAppendV;
-using base::SStringPrintf;
-using base::StringPiece;
-using base::StringPrintf;
+static const int32 kint32max = 0x7FFFFFFF;
+static const int32 kint32min = -kint32max - 1;
+
+using namespace absl;
+
+class StringPiece : public string_view {
+public:
+  StringPiece(const absl::string_view& s) : absl::string_view(s) {}
+  StringPiece(const GoogleString& s) : absl::string_view(s.data(), s.size()) {}
+
+  using string_view::string_view;
+  void CopyToString(GoogleString* dest) const {
+    *dest = std::string(*this);
+  }
+  void AppendToString(GoogleString* dest) const {
+    (*dest).append(std::string(*this));
 
 Review comment:
   this temp can be avoided.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services