--- parser3/src/include/pa_hash.h 2025/01/06 19:47:18 1.105 +++ parser3/src/include/pa_hash.h 2026/04/25 13:38:46 1.108 @@ -1,7 +1,7 @@ /** @file Parser: hash class decl. - Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ @@ -9,7 +9,7 @@ #ifndef PA_HASH_H #define PA_HASH_H -#define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.105 2025/01/06 19:47:18 moko Exp $" +#define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.108 2026/04/25 13:38:46 moko Exp $" #include "pa_memory.h" #include "pa_types.h" @@ -104,6 +104,9 @@ inline uint hash_code(int self) { #endif +#define HASH_PUT_CSTR(h, cstr, v) \ + { static const String::Body body_##__LINE__(cstr); (h).put(body_##__LINE__, (v)); } + template class HASH: public PA_Object { protected: class Pair; @@ -480,6 +483,10 @@ public: return false; } + bool put(const char *str, V value) { + return put(String::Body(str), value); + } + /// remove the [key] @returns existed or not bool remove(K str) { CORD key=str.get_cord();