utils.h 557 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <library/cpp/scheme/scheme.h>
  3. #include <util/generic/strbuf.h>
  4. #include <util/ysaveload.h>
  5. namespace NScUtils {
  6. void CopyField(const NSc::TValue& from, NSc::TValue& to);
  7. template <typename... Args>
  8. void CopyField(const NSc::TValue& from, NSc::TValue& to, TStringBuf path, Args... args) {
  9. CopyField(from[path], to[path], args...);
  10. }
  11. } // namespace NScUtils
  12. template<>
  13. struct TSerializer<NSc::TValue> {
  14. static void Save(IOutputStream* out, const NSc::TValue& v);
  15. static void Load(IInputStream* in, NSc::TValue& v);
  16. };