diff --git a/Framework/DataHandling/src/LoadPSIMuonBin.cpp b/Framework/DataHandling/src/LoadPSIMuonBin.cpp index 0ea67e70384413b8e42771e078a772348fd61a02..3c88b338eb6e2aa5416af946df583fa415c01717 100644 --- a/Framework/DataHandling/src/LoadPSIMuonBin.cpp +++ b/Framework/DataHandling/src/LoadPSIMuonBin.cpp @@ -122,10 +122,18 @@ void LoadPSIMuonBin::exec() { std::string LoadPSIMuonBin::getFormattedDateTime(std::string date, std::string time) { - std::map<std::string, std::string> months{ - {"JAN", "01"}, {"FEB", "02"}, {"MAR", "03"}, {"APR", "04"}, - {"MAY", "05"}, {"JUN", "06"}, {"JUL", "07"}, {"AUG", "08"}, - {"SEP", "09"}, {"OCT", "10"}, {"NOV", "11"}, {"DEC", "12"}}; + std::map<std::string, std::string> months{{"JAN", "01"}, + {"FEB", "02"}, + {"MAR", "03"}, + {"APR", "04"}, + {"MAY", "05"}, + {"JUN", "06"}, + {"JUL", "07"}, + {"AUG", "08"}, + {"SEP", "09"}, + {"OCT", "10"}, + {"NOV", "11"}, + {"DEC", "12"}}; return "20" + date.substr(7, 2) + "-" + months.find(date.substr(3, 3))->second + "-" + date.substr(0, 2) + "T" + time; @@ -157,10 +165,9 @@ void LoadPSIMuonBin::readSingleVariables( streamReader >> m_header.histogramBinWidth; if (m_header.histogramBinWidth == 0) { - m_header.histogramBinWidth = - static_cast<float>((625.E-6) / 8. * - pow(static_cast<float>(2.), - static_cast<float>(m_header.tdcResolution))); + m_header.histogramBinWidth = static_cast<float>( + (625.E-6) / 8. * pow(static_cast<float>(2.), + static_cast<float>(m_header.tdcResolution))); } streamReader.moveStreamToPosition(712); @@ -338,8 +345,8 @@ void LoadPSIMuonBin::generateUnknownAxis() { void LoadPSIMuonBin::assignOutputWorkspaceParticulars( DataObjects::Workspace2D_sptr &outputWorkspace) { // Sort some workspace particulars - outputWorkspace->setTitle(m_header.sample + - " - Run:" + std::to_string(m_header.numberOfRuns)); + outputWorkspace->setTitle(m_header.sample + " - Run:" + + std::to_string(m_header.numberOfRuns)); // Set axis variables outputWorkspace->setYUnit("Counts"); diff --git a/Framework/Kernel/inc/MantidKernel/BinaryStreamReader.h b/Framework/Kernel/inc/MantidKernel/BinaryStreamReader.h index baf44a0d35fd69d980fe71ebdf635955605983d0..518ca80b8ab4d5ff239b161d69e05ea8725beca6 100644 --- a/Framework/Kernel/inc/MantidKernel/BinaryStreamReader.h +++ b/Framework/Kernel/inc/MantidKernel/BinaryStreamReader.h @@ -85,6 +85,7 @@ public: /// Move the stream to nbytes past the beginning of the file void moveStreamToPosition(size_t nbytes); + private: /// Reference to the stream being read std::istream &m_istrm; diff --git a/Framework/Kernel/src/BinaryStreamReader.cpp b/Framework/Kernel/src/BinaryStreamReader.cpp index a5401ef5b933a9cb510c95bc9ac4b6671b27b4a7..4e461e74954d6138d0e042cd76c74fd0eda21a19 100644 --- a/Framework/Kernel/src/BinaryStreamReader.cpp +++ b/Framework/Kernel/src/BinaryStreamReader.cpp @@ -100,9 +100,9 @@ BinaryStreamReader::BinaryStreamReader(std::istream &istrm) /** * Read a int16_t from the stream * @param value the value is stored in the given stream - * @return BinaryStreamReader& + * @return BinaryStreamReader& */ -BinaryStreamReader &BinaryStreamReader::operator>>(int16_t &value){ +BinaryStreamReader &BinaryStreamReader::operator>>(int16_t &value) { readFromStream(m_istrm, value); return *this; } @@ -169,7 +169,7 @@ BinaryStreamReader &BinaryStreamReader::operator>>(std::string &value) { * Read an array of int16_t into the given vector. * @param value The array to fille. Its size is increased if necessary * @param nvals The number values to attempt to read from the stream - * @return A reference to the BinaryStreamReader object + * @return A reference to the BinaryStreamReader object */ BinaryStreamReader &BinaryStreamReader::read(std::vector<int16_t> &value, const size_t nvals) { @@ -310,7 +310,7 @@ BinaryStreamReader::read(Kernel::Matrix<double> &value, } /** - * Will move the stream to the given position + * Will move the stream to the given position * @param nbytes The number of bytes from position 0 to move */ void BinaryStreamReader::moveStreamToPosition(size_t nbytes) { diff --git a/Framework/Kernel/test/BinaryStreamReaderTest.h b/Framework/Kernel/test/BinaryStreamReaderTest.h index be40b9750a3ea65dac24ec9943d54bbd43a9bb0e..e2fd67a5622873d7eb13e8d60dbd9c956da9525c 100644 --- a/Framework/Kernel/test/BinaryStreamReaderTest.h +++ b/Framework/Kernel/test/BinaryStreamReaderTest.h @@ -35,7 +35,7 @@ public: TS_ASSERT_EQUALS(std::ios_base::beg, m_bytes.tellg()); } - void test_Read_int16_t_Gives_Correct_Value(){ + void test_Read_int16_t_Gives_Correct_Value() { doReadSingleValueTest<int16_t>(6, sizeof(int16_t)); } @@ -65,7 +65,7 @@ public: doReadSingleValueTest<std::string>("mantid", offset); } - void test_Read_Vector_int16_t(){ + void test_Read_Vector_int16_t() { moveStreamToPosition(30); const size_t nvals(3); std::vector<int16_t> expectedValue{2, 0, 4};