#include "CppGen/Subnet.h"
#include "Dims.h"
+#include "String.h"
#include <pp/LinearDocument.h>
#include <sstream>
using nncc::foundation::make_unique;
+using enco::concat;
#define S(content) #content
namespace
{
-template <typename It> void concat(std::ostream &os, const std::string &sep, It beg, It end)
-{
- uint32_t count = 0;
-
- for (auto it = beg; it != end; ++it, ++count)
- {
- if (count == 0)
- {
- os << *it;
- }
- else
- {
- os << sep << *it;
- }
- }
-}
-
-template <typename It> std::string concat(const std::string &sep, It beg, It end)
-{
- std::stringstream ss;
- concat(ss, sep, beg, end);
- return ss.str();
-}
-} // namespace
-
-namespace
-{
class SubnetStructImpl final : public enco::SubnetStruct
{
--- /dev/null
+#ifndef __ENCO_STRING_H__
+#define __ENCO_STRING_H__
+
+//
+// String-manipulating routines
+//
+#include <ostream>
+#include <sstream>
+
+#include <string>
+
+namespace enco
+{
+
+template <typename It> void concat(std::ostream &os, const std::string &sep, It beg, It end)
+{
+ uint32_t count = 0;
+
+ for (auto it = beg; it != end; ++it, ++count)
+ {
+ if (count == 0)
+ {
+ os << *it;
+ }
+ else
+ {
+ os << sep << *it;
+ }
+ }
+}
+
+template <typename It> std::string concat(const std::string &sep, It beg, It end)
+{
+ std::stringstream ss;
+ concat(ss, sep, beg, end);
+ return ss.str();
+}
+
+} // namespace enco
+
+#endif // __ENCO_STRING_H__