Remove Abseil use from platfrom/api and platform/base.
Replaces Abseil library calls with STL equivalents, or re-implemented
equivalents. In particular, std::variant in ErrorOr<> was replaced with
a raw union (plus ctor/dtor voodoo). Also, cleaned up IPAddress ctors
and parsing routines.
Bug: openscreen:88
Change-Id: Idba4080a7b8e179067313fbcc04758a5463e621a
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1947904
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Jordan Bayles <jophba@chromium.org>
Commit-Queue: Yuri Wiitala <miu@chromium.org>
diff --git a/platform/api/logging.h b/platform/api/logging.h
index 9ff79d1..0dea6d4 100644
--- a/platform/api/logging.h
+++ b/platform/api/logging.h
@@ -5,7 +5,7 @@
#ifndef PLATFORM_API_LOGGING_H_
#define PLATFORM_API_LOGGING_H_
-#include "absl/strings/string_view.h"
+#include <sstream>
namespace openscreen {
namespace platform {
@@ -36,17 +36,20 @@
// Returns true if |level| is at or above the level where the embedder will
// record/emit log entries from the code in |file|.
-bool IsLoggingOn(LogLevel level, absl::string_view file);
+bool IsLoggingOn(LogLevel level, const char* file);
// Record a log entry, consisting of its logging level, location and message.
// The embedder may filter-out entries according to its own policy, but this
// function will not be called if IsLoggingOn(level, file) returns false.
// Whenever |level| is kFatal, Open Screen will call Break() immediately after
// this returns.
+//
+// |message| is passed as a string stream to avoid unnecessary string copies.
+// Embedders can call its rdbuf() or str() methods to access the log message.
void LogWithLevel(LogLevel level,
- absl::string_view file,
+ const char* file,
int line,
- absl::string_view msg);
+ std::stringstream message);
// Breaks into the debugger, if one is present. Otherwise, aborts the current
// process (i.e., this function should not return). In production builds, an