Example #1
0
        /// <summary>
        /// Opens an existing file and loads up the group and dataset headers in the object.
        /// </summary>
        /// <param name="_filename"></param>
        public Hdf5File(string _filename)
        {
            if (!File.Exists(_filename))
            {
                throw new FileNotFoundException();
            }

            Id = H5F.open(_filename, H5F.ACC_RDWR).ToId();

            if (Id.Value > 0)
            {
                FileId = Id;
                Path   = new Hdf5Path(".");

                Groups   = new Hdf5Groups(this);
                Datasets = new Hdf5Datasets(this);

                Attributes = new Hdf5Attributes(this);
                AttributeHelper.LoadAttributes(Attributes);

                GroupHelper.PopulateChildrenObjects(Id, this);
            }
            else
            {
                throw new Hdf5UnknownException();
            }
        }
Example #2
0
        internal Hdf5Group(
            Hdf5Identifier _fileId,
            Hdf5Identifier _groupId,
            string _path)
        {
            FileId = _fileId;
            Id     = _groupId;

            Path = new Hdf5Path(_path);
            Name = Path.Name;

            Groups   = new Hdf5Groups(this);
            Datasets = new Hdf5Datasets(this);

            Attributes = new Hdf5Attributes(this);
            AttributeHelper.LoadAttributes(Attributes);
        }