ITS.ITU.PSeries.P2108 1.0
Part of the NTIA/ITS Propagation Library
Loading...
Searching...
No Matches
CommaSeparatedIterator.h
Go to the documentation of this file.
1
4#pragma once
5
6#include <istream> // for std::istream
7#include <string> // For std::string
8#include <utility> // for std::pair
9
10
18 public:
20 using value_type = std::pair<std::string, std::string>;
21
22
27 CommaSeparatedIterator(std::istream &stream);
28
31
33 value_type operator*() const;
34
36 explicit operator bool() const;
37 private:
38 std::istream &stream_;
39 std::string line_;
40 std::string first_;
41 std::string second_;
42};
An iterator that reads lines from an input stream, splitting each line into two strings based on a co...
Definition CommaSeparatedIterator.h:17
std::string first_
First string from the current line.
Definition CommaSeparatedIterator.h:40
CommaSeparatedIterator & operator++()
Pre-increment operator to advance the iterator to the next line.
Definition CommaSeparatedIterator.cpp:27
std::string second_
Second string from the current line.
Definition CommaSeparatedIterator.h:41
std::pair< std::string, std::string > value_type
Type alias for the value returned by the iterator (pair of strings)
Definition CommaSeparatedIterator.h:20
value_type operator*() const
Dereference operator to obtain the current pair of substrings.
Definition CommaSeparatedIterator.cpp:65
std::istream & stream_
Reference to the input stream.
Definition CommaSeparatedIterator.h:38
std::string line_
Current line read from the stream.
Definition CommaSeparatedIterator.h:39
CommaSeparatedIterator(std::istream &stream)
Constructor method.
Definition CommaSeparatedIterator.cpp:13
Privacy Policy FOIA Accessibility Information Quality