Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-27 09:45:02

0001 // Created on: 1992-11-25
0002 // Created by: Julia DOROVSKIKH
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _XmlObjMgt_Array1_HeaderFile
0018 #define _XmlObjMgt_Array1_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <XmlObjMgt_Element.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <XmlObjMgt_DOMString.hxx>
0026 
0027 //! The class Array1 represents unidimensional
0028 //! array of fixed size known at run time.
0029 //! The range of the index is user defined.
0030 //! Warning: Programs clients of such class must be independent
0031 //! of the range of the first element. Then, a C++ for
0032 //! loop must be written like this
0033 //! for (i = A->Lower(); i <= A->Upper(); i++)
0034 class XmlObjMgt_Array1
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Create an array of lower bound <Low> and
0040   //! upper bound <Up>. Range error is raised
0041   //! when <Up> is less than <Low>.
0042   Standard_EXPORT XmlObjMgt_Array1(const Standard_Integer Low, const Standard_Integer Up);
0043 
0044   //! for restoration from DOM_Element which is child of
0045   //! theParent:
0046   //! <theParent ...>
0047   //! <theName ...>
0048   Standard_EXPORT XmlObjMgt_Array1(const XmlObjMgt_Element&   theParent,
0049                                    const XmlObjMgt_DOMString& theName);
0050 
0051   //! Create DOM_Element representing the array, under 'theParent'
0052   Standard_EXPORT void CreateArrayElement(XmlObjMgt_Element&         theParent,
0053                                           const XmlObjMgt_DOMString& theName);
0054 
0055   //! Returns the DOM element of <me>.
0056   const XmlObjMgt_Element& Element() const;
0057 
0058   //! Returns the number of elements of <me>.
0059   Standard_Integer Length() const;
0060 
0061   //! Returns the lower bound.
0062   Standard_Integer Lower() const;
0063 
0064   //! Returns the upper bound.
0065   Standard_Integer Upper() const;
0066 
0067   //! Set the <Index>th element of the array to <Value>.
0068   Standard_EXPORT void SetValue(const Standard_Integer Index, XmlObjMgt_Element& Value);
0069 
0070   //! Returns the value of <Index>th element of the array.
0071   Standard_EXPORT XmlObjMgt_Element Value(const Standard_Integer Index) const;
0072 
0073 protected:
0074 private:
0075   XmlObjMgt_Element myElement;
0076   Standard_Integer  myFirst;
0077   Standard_Integer  myLast;
0078 };
0079 
0080 #include <XmlObjMgt_Array1.lxx>
0081 
0082 #endif // _XmlObjMgt_Array1_HeaderFile