/* $Id: cpl_property.h,v 1.10 2007/07/17 09:37:33 scastro Exp $ * * This file is part of the ESO Common Pipeline Library * Copyright (C) 2001-2005 European Southern Observatory * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * $Author: scastro $ * $Date: 2007/07/17 09:37:33 $ * $Revision: 1.10 $ * $Name: $ */ #ifndef CPL_PROPERTY_H #define CPL_PROPERTY_H #include #include CPL_BEGIN_DECLS /** * @ingroup cpl_property * * @brief * The opaque property data type. */ typedef struct _cpl_property_ cpl_property; /* * Create, copy and destroy operations. */ cpl_property *cpl_property_new(const char *name, cpl_type type); cpl_property *cpl_property_new_array(const char *name, cpl_type type, int size); cpl_property *cpl_property_duplicate(const cpl_property *other); void cpl_property_delete(cpl_property *self); /* * Non modifying operations */ long cpl_property_get_size(const cpl_property *self); cpl_type cpl_property_get_type(const cpl_property *self); /* * Assignment operations */ cpl_error_code cpl_property_set_name(cpl_property *self, const char *name); cpl_error_code cpl_property_set_comment(cpl_property *self, const char *comment); cpl_error_code cpl_property_set_char(cpl_property *self, char value); cpl_error_code cpl_property_set_bool(cpl_property *self, int value); cpl_error_code cpl_property_set_int(cpl_property *self, int value); cpl_error_code cpl_property_set_long(cpl_property *self, long value); cpl_error_code cpl_property_set_float(cpl_property *self, float value); cpl_error_code cpl_property_set_double(cpl_property *self, double value); cpl_error_code cpl_property_set_string(cpl_property *self, const char *value); /* * Element access */ const char *cpl_property_get_name(const cpl_property *self); const char *cpl_property_get_comment(const cpl_property *self); char cpl_property_get_char(const cpl_property *self); int cpl_property_get_bool(const cpl_property *self); int cpl_property_get_int(const cpl_property *self); long cpl_property_get_long(const cpl_property *self); float cpl_property_get_float(const cpl_property *self); double cpl_property_get_double(const cpl_property *self); const char *cpl_property_get_string(const cpl_property *self); CPL_END_DECLS #endif /* CPL_PROPERTY_H */