1 /* 2 * Python object wrapper of libolecf_property_value_t 3 * 4 * Copyright (C) 2008-2021, Joachim Metz <joachim.metz@gmail.com> 5 * 6 * Refer to AUTHORS for acknowledgements. 7 * 8 * This program is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU Lesser General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License 19 * along with this program. If not, see <https://www.gnu.org/licenses/>. 20 */ 21 22 #if !defined( _PYOLECF_PROPERTY_VALUE_H ) 23 #define _PYOLECF_PROPERTY_VALUE_H 24 25 #include <common.h> 26 #include <types.h> 27 28 #include "pyolecf_libolecf.h" 29 #include "pyolecf_python.h" 30 31 #if defined( __cplusplus ) 32 extern "C" { 33 #endif 34 35 typedef struct pyolecf_property_value pyolecf_property_value_t; 36 37 struct pyolecf_property_value 38 { 39 /* Python object initialization 40 */ 41 PyObject_HEAD 42 43 /* The libolecf property value 44 */ 45 libolecf_property_value_t *property_value; 46 47 /* The parent object 48 */ 49 PyObject *parent_object; 50 }; 51 52 extern PyMethodDef pyolecf_property_value_object_methods[]; 53 extern PyTypeObject pyolecf_property_value_type_object; 54 55 PyObject *pyolecf_property_value_new( 56 libolecf_property_value_t *property_value, 57 PyObject *parent_object ); 58 59 int pyolecf_property_value_init( 60 pyolecf_property_value_t *pyolecf_property_value ); 61 62 void pyolecf_property_value_free( 63 pyolecf_property_value_t *pyolecf_property_value ); 64 65 PyObject *pyolecf_property_value_get_identifier( 66 pyolecf_property_value_t *pyolecf_property_value, 67 PyObject *arguments ); 68 69 PyObject *pyolecf_property_value_get_value_type( 70 pyolecf_property_value_t *pyolecf_property_value, 71 PyObject *arguments ); 72 73 PyObject *pyolecf_property_value_get_data( 74 pyolecf_property_value_t *pyolecf_property_value, 75 PyObject *arguments ); 76 77 PyObject *pyolecf_property_value_get_data_as_boolean( 78 pyolecf_property_value_t *pyolecf_property_value, 79 PyObject *arguments ); 80 81 PyObject *pyolecf_property_value_get_data_as_integer( 82 pyolecf_property_value_t *pyolecf_property_value, 83 PyObject *arguments ); 84 85 PyObject *pyolecf_property_value_get_data_as_datetime( 86 pyolecf_property_value_t *pyolecf_property_value, 87 PyObject *arguments ); 88 89 PyObject *pyolecf_property_value_get_data_as_string( 90 pyolecf_property_value_t *pyolecf_property_value, 91 PyObject *arguments ); 92 93 #if defined( __cplusplus ) 94 } 95 #endif 96 97 #endif /* !defined( _PYOLECF_PROPERTY_VALUE_H ) */ 98 99