From a40bab0445139b128593e89afd32f5ebc519cc2d Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Mon, 30 May 2022 00:55:38 +0200 Subject: [PATCH] add Space::get_table_item() method --- src/space/space.cpp | 14 +++++++++++++- src/space/space.h | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/space/space.cpp b/src/space/space.cpp index 9baa939..d8cc41e 100644 --- a/src/space/space.cpp +++ b/src/space/space.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2008-2021, Tomasz Sowa + * Copyright (c) 2008-2022, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -2577,6 +2577,18 @@ void Space::remove_value_table(bool only_clear) } +Space * Space::get_table_item(size_t index) +{ + if( is_table() && index < table_size() ) + { + return value.value_table[index]; + } + + return nullptr; +} + + + } // namespace diff --git a/src/space/space.h b/src/space/space.h index cb9ebbe..1332c62 100644 --- a/src/space/space.h +++ b/src/space/space.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2010-2021, Tomasz Sowa + * Copyright (c) 2010-2022, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -635,7 +635,7 @@ public: bool has_value(const wchar_t * field, const std::wstring & val) const; - + Space * get_table_item(size_t index); protected: