From f4ed8bbde51728ef85e2b5bc043ed9c8938fa469 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Fri, 29 Jun 2018 13:21:32 +0200 Subject: [PATCH] document some more features of alib2std --- alib2std/src/extensions/init.h | 39 +++++++++++++++++++++++++++- alib2std/src/extensions/iostream.hpp | 20 ++++++++++++++ alib2std/src/extensions/istream.h | 25 ++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/alib2std/src/extensions/init.h b/alib2std/src/extensions/init.h index ad6bf964e9..f857fc8066 100644 --- a/alib2std/src/extensions/init.h +++ b/alib2std/src/extensions/init.h @@ -1,5 +1,21 @@ /* - * iostream.hpp + * init.hpp + * + * This file is part of Algorithms library toolkit. + * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz) + + * Algorithms library toolkit 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 3 of the License, or + * (at your option) any later version. + + * Algorithms library toolkit 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 Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>. * * Created on: Feb 12, 2016 * Author: Radovan Cerveny @@ -13,11 +29,32 @@ namespace ext { +/** + * Class responsible for initialisation of std extensions and standard library changes. + * + * Includes seeding of semirandom device and redirection of clog stream + */ class Init { + /** + * \brief + * Instance of a class determining the used file descriptor for clog stream from prefered (if available) and fallback file descriptor. + */ fdaccessor clog_fdaccessor; + + /** + * \brief + * Instance of a class representing buffered stream for clog stream designed to work on defined file descriptor instead of usual file name. + */ fdstreambuf clog_fdstreambuf; public: + /** + * Constructor of the initialisation class. + */ Init ( ); + + /** + * Destructor of the initialisation class. + */ ~Init ( ); }; diff --git a/alib2std/src/extensions/iostream.hpp b/alib2std/src/extensions/iostream.hpp index b45fb4cc7d..3fa8d06ede 100644 --- a/alib2std/src/extensions/iostream.hpp +++ b/alib2std/src/extensions/iostream.hpp @@ -1,6 +1,22 @@ /* * iostream.hpp * + * This file is part of Algorithms library toolkit. + * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz) + + * Algorithms library toolkit 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 3 of the License, or + * (at your option) any later version. + + * Algorithms library toolkit 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 Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>. + * * Created on: Feb 12, 2016 * Author: Radovan Cerveny */ @@ -13,6 +29,10 @@ namespace ext { +/** + * \brief + * Instance of the cmeasure stream. Default behavior is output to cout, but when the descriptor number 5 is redirected the cmeasure destination is to that descriptor. + */ extern ofdstream cmeasure; } /* namespace ext */ diff --git a/alib2std/src/extensions/istream.h b/alib2std/src/extensions/istream.h index c778634dc5..c317bc3c21 100644 --- a/alib2std/src/extensions/istream.h +++ b/alib2std/src/extensions/istream.h @@ -1,6 +1,22 @@ /* * istream.h * + * This file is part of Algorithms library toolkit. + * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz) + + * Algorithms library toolkit 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 3 of the License, or + * (at your option) any later version. + + * Algorithms library toolkit 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 Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>. + * * Created on: Apr 1, 2013 * Author: Jan Travnicek */ @@ -14,6 +30,15 @@ namespace ext { +/** + * \brief + * Read into a constant string. The implementation tests whether exact same sequence represented as \p str is in the \p in stream. In case it is, it reads it. In case it is not the stream is not advanced and fail bit is set. + * + * \param in the input stream + * \param str the string to test + * + * \return the in stream either with fail bit set if str is not in the stream or advanced by reading str. + */ std::istream & operator >> ( std::istream & in, const ext::string & str ); } /* namespace ext */ -- GitLab