Skip to content

Commit

Permalink
Merge pull request Unidata#130 from hellkite500/const-fixes
Browse files Browse the repository at this point in the history
add const qualifier to NcFile header signatures
  • Loading branch information
WardF authored Feb 14, 2023
2 parents 4d5a7ad + a10043b commit f2dcc94
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cxx4/ncFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace netCDF
\aram ncFileFlags File flags from netcdf.h
*/

NcFile(const std::string& filePath, int ncFileFlags);
NcFile(const std::string& filePath, const int ncFileFlags);


/*!
Expand All @@ -57,14 +57,14 @@ namespace netCDF
- 'replace' Create new file, even it already exists.
- 'newFile' Create new file, fail it exists already.
*/
NcFile(const std::string& filePath, FileMode fMode);
NcFile(const std::string& filePath, const FileMode fMode);

/*!
Create a netCDF file.
\param filePath Name of netCDF optional path.
\param ncFileFlags File flags from netcdf.h
*/
void create(const std::string& filePath, int ncFileFlags);
void create(const std::string& filePath, const int ncFileFlags);

/*!
Opens a netCDF file.
Expand All @@ -83,7 +83,7 @@ namespace netCDF
- 'replace' Create new file, even it already exists.
- 'newFile' Create new file, fail it exists already.
*/
void open(const std::string& filePath, FileMode fMode);
void open(const std::string& filePath, const FileMode fMode);

/*!
Creates a netCDF file of a specified format.
Expand All @@ -92,15 +92,15 @@ namespace netCDF
- 'replace' Create new file, even it already exists.
- 'newFile' Create new file, fail it exists already.
*/
NcFile(const std::string& filePath, FileMode fMode, FileFormat fFormat);
NcFile(const std::string& filePath, const FileMode fMode, const FileFormat fFormat);
/*!
Creates a netCDF file of a specified format.
\param filePath Name of netCDF optional path.
\param fMode The file mode:
- 'replace' Create new file, even it already exists.
- 'newFile' Create new file, fail it exists already.
*/
void open(const std::string& filePath, FileMode fMode, FileFormat fFormat);
void open(const std::string& filePath, const FileMode fMode, const FileFormat fFormat);

//! Close a file before destructor call
void close();
Expand All @@ -121,13 +121,13 @@ namespace netCDF
void enddef();


private:
/* Do not allow definition of NcFile involving copying any NcFile or NcGroup.
Because the destructor closes the file and releases al resources such
an action could leave NcFile objects in an invalid state */
NcFile& operator =(const NcGroup & rhs);
NcFile& operator =(const NcFile & rhs);
NcFile(const NcGroup& rhs);
private:
/* Do not allow definition of NcFile involving copying any NcFile or NcGroup.
Because the destructor closes the file and releases al resources such
an action could leave NcFile objects in an invalid state */
NcFile& operator =(const NcGroup & rhs);
NcFile& operator =(const NcFile & rhs);
NcFile(const NcGroup& rhs);
NcFile(const NcFile& rhs);
};

Expand Down

0 comments on commit f2dcc94

Please sign in to comment.