summaryrefslogtreecommitdiffstats
path: root/contrib/libs/poco/Net/src/StringPartSource.cpp
diff options
context:
space:
mode:
authorDevtools Arcadia <[email protected]>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <[email protected]>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/libs/poco/Net/src/StringPartSource.cpp
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/libs/poco/Net/src/StringPartSource.cpp')
-rw-r--r--contrib/libs/poco/Net/src/StringPartSource.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/contrib/libs/poco/Net/src/StringPartSource.cpp b/contrib/libs/poco/Net/src/StringPartSource.cpp
new file mode 100644
index 00000000000..a512449f69f
--- /dev/null
+++ b/contrib/libs/poco/Net/src/StringPartSource.cpp
@@ -0,0 +1,67 @@
+//
+// StringPartSource.cpp
+//
+// Library: Net
+// Package: Messages
+// Module: StringPartSource
+//
+// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier: BSL-1.0
+//
+
+
+#include "Poco/Net/StringPartSource.h"
+
+
+namespace Poco {
+namespace Net {
+
+
+StringPartSource::StringPartSource(const std::string& str):
+ PartSource("text/plain"),
+ _istr(str)
+{
+}
+
+
+StringPartSource::StringPartSource(const std::string& str, const std::string& mediaType):
+ PartSource(mediaType),
+ _istr(str)
+{
+}
+
+
+StringPartSource::StringPartSource(const std::string& str, const std::string& mediaType, const std::string& filename):
+ PartSource(mediaType),
+ _istr(str),
+ _filename(filename)
+{
+}
+
+
+StringPartSource::~StringPartSource()
+{
+}
+
+
+std::istream& StringPartSource::stream()
+{
+ return _istr;
+}
+
+
+const std::string& StringPartSource::filename() const
+{
+ return _filename;
+}
+
+
+std::streamsize StringPartSource::getContentLength() const
+{
+ return _istr.str().length();
+}
+
+
+} } // namespace Poco::Net