Skip to content

Commit 7540d1c

Browse files
committed
fixed indentation in comment
1 parent 713c5fd commit 7540d1c

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

csv.h

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
// 1. Redistributions of source code must retain the above copyright notice,
1010
// this list of conditions and the following disclaimer.
1111
//
12-
//2. Redistributions in binary form must reproduce the above copyright notice,
13-
// this list of conditions and the following disclaimer in the documentation
14-
// and/or other materials provided with the distribution.
12+
// 2. Redistributions in binary form must reproduce the above copyright notice,
13+
// this list of conditions and the following disclaimer in the documentation
14+
// and/or other materials provided with the distribution.
1515
//
16-
//3. Neither the name of the copyright holder nor the names of its contributors
17-
// may be used to endorse or promote products derived from this software
18-
// without specific prior written permission.
16+
// 3. Neither the name of the copyright holder nor the names of its contributors
17+
// may be used to endorse or promote products derived from this software
18+
// without specific prior written permission.
1919
//
2020
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2121
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -56,8 +56,8 @@ namespace io{
5656

5757
namespace error{
5858
struct base : std::exception{
59-
virtual void format_error_message()const = 0;
60-
59+
virtual void format_error_message()const = 0;
60+
6161
const char*what()const noexcept override{
6262
format_error_message();
6363
return error_message_buffer;
@@ -72,7 +72,7 @@ namespace io{
7272
with_file_name(){
7373
std::memset(file_name, 0, sizeof(file_name));
7474
}
75-
75+
7676
void set_file_name(const char*file_name){
7777
if(file_name != nullptr){
7878
strncpy(this->file_name, file_name, sizeof(this->file_name));
@@ -89,7 +89,7 @@ namespace io{
8989
with_file_line(){
9090
file_line = -1;
9191
}
92-
92+
9393
void set_file_line(int file_line){
9494
this->file_line = file_line;
9595
}
@@ -101,7 +101,7 @@ namespace io{
101101
with_errno(){
102102
errno_value = 0;
103103
}
104-
104+
105105
void set_errno(int errno_value){
106106
this->errno_value = errno_value;
107107
}
@@ -214,7 +214,7 @@ namespace io{
214214
try{
215215
for(;;){
216216
read_requested_condition.wait(
217-
guard,
217+
guard,
218218
[&]{
219219
return desired_byte_count != -1 || termination_requested;
220220
}
@@ -251,7 +251,7 @@ namespace io{
251251
int finish_read(){
252252
std::unique_lock<std::mutex>guard(lock);
253253
read_finished_condition.wait(
254-
guard,
254+
guard,
255255
[&]{
256256
return read_byte_count != -1 || read_error;
257257
}
@@ -273,7 +273,7 @@ namespace io{
273273
}
274274
}
275275

276-
private:
276+
private:
277277
std::unique_ptr<ByteSourceBase>byte_source;
278278

279279
std::thread worker;
@@ -286,7 +286,7 @@ namespace io{
286286

287287
std::mutex lock;
288288
std::condition_variable read_finished_condition;
289-
std::condition_variable read_requested_condition;
289+
std::condition_variable read_requested_condition;
290290
};
291291
#endif
292292

@@ -504,7 +504,7 @@ namespace io{
504504
with_column_name(){
505505
std::memset(column_name, 0, max_column_name_length+1);
506506
}
507-
507+
508508
void set_column_name(const char*column_name){
509509
if(column_name != nullptr){
510510
std::strncpy(this->column_name, column_name, max_column_name_length);
@@ -524,7 +524,7 @@ namespace io{
524524
with_column_content(){
525525
std::memset(column_content, 0, max_column_content_length+1);
526526
}
527-
527+
528528
void set_column_content(const char*column_content){
529529
if(column_content != nullptr){
530530
std::strncpy(this->column_content, column_content, max_column_content_length);
@@ -691,7 +691,7 @@ namespace io{
691691
constexpr static bool is_trim_char(char){
692692
return false;
693693
}
694-
694+
695695
template<class ...OtherTrimChars>
696696
constexpr static bool is_trim_char(char c, char trim_char, OtherTrimChars...other_trim_chars){
697697
return c == trim_char || is_trim_char(c, other_trim_chars...);
@@ -720,7 +720,7 @@ namespace io{
720720
constexpr static bool is_comment_start_char(char){
721721
return false;
722722
}
723-
723+
724724
template<class ...OtherCommentStartChars>
725725
constexpr static bool is_comment_start_char(char c, char comment_start_char, OtherCommentStartChars...other_comment_start_chars){
726726
return c == comment_start_char || is_comment_start_char(c, other_comment_start_chars...);
@@ -782,8 +782,8 @@ namespace io{
782782
}
783783
++col_begin;
784784
}while(*col_begin == quote);
785-
}
786-
return col_begin;
785+
}
786+
return col_begin;
787787
}
788788

789789
static void unescape(char*&col_begin, char*&col_end){
@@ -803,7 +803,7 @@ namespace io{
803803
*col_end = '\0';
804804
}
805805
}
806-
806+
807807
}
808808
};
809809

@@ -812,7 +812,7 @@ namespace io{
812812
static void on_overflow(T&){
813813
throw error::integer_overflow();
814814
}
815-
815+
816816
template<class T>
817817
static void on_underflow(T&){
818818
throw error::integer_underflow();
@@ -822,7 +822,7 @@ namespace io{
822822
struct ignore_overflow{
823823
template<class T>
824824
static void on_overflow(T&){}
825-
825+
826826
template<class T>
827827
static void on_underflow(T&){}
828828
};
@@ -832,7 +832,7 @@ namespace io{
832832
static void on_overflow(T&x){
833833
x = std::numeric_limits<T>::max();
834834
}
835-
835+
836836
template<class T>
837837
static void on_underflow(T&x){
838838
x = std::numeric_limits<T>::min();
@@ -850,12 +850,12 @@ namespace io{
850850
col_begin = line;
851851
// the col_begin + (... - col_begin) removes the constness
852852
col_end = col_begin + (quote_policy::find_next_column_end(col_begin) - col_begin);
853-
853+
854854
if(*col_end == '\0'){
855855
line = nullptr;
856856
}else{
857857
*col_end = '\0';
858-
line = col_end + 1;
858+
line = col_end + 1;
859859
}
860860
}
861861

@@ -874,7 +874,7 @@ namespace io{
874874
if (i != -1) {
875875
trim_policy::trim(col_begin, col_end);
876876
quote_policy::unescape(col_begin, col_end);
877-
877+
878878
sorted_col[i] = col_begin;
879879
}
880880
}
@@ -899,7 +899,7 @@ namespace io{
899899

900900
trim_policy::trim(col_begin, col_end);
901901
quote_policy::unescape(col_begin, col_end);
902-
902+
903903
for(unsigned i=0; i<column_count; ++i)
904904
if(col_begin == col_name[i]){
905905
if(found[i]){
@@ -942,7 +942,7 @@ namespace io{
942942
if(*col)
943943
throw error::invalid_single_character();
944944
}
945-
945+
946946
template<class overflow_policy>
947947
void parse(char*col, std::string&x){
948948
x = col;
@@ -985,7 +985,7 @@ namespace io{
985985
{parse_unsigned_integer<overflow_policy>(col, x);}
986986
template<class overflow_policy>void parse(char*col, unsigned long long &x)
987987
{parse_unsigned_integer<overflow_policy>(col, x);}
988-
988+
989989
template<class overflow_policy, class T>
990990
void parse_signed_integer(const char*col, T&x){
991991
if(*col == '-'){
@@ -1008,7 +1008,7 @@ namespace io{
10081008
}else if(*col == '+')
10091009
++col;
10101010
parse_unsigned_integer<overflow_policy>(col, x);
1011-
}
1011+
}
10121012

10131013
template<class overflow_policy>void parse(char*col, signed char &x)
10141014
{parse_signed_integer<overflow_policy>(col, x);}
@@ -1037,7 +1037,7 @@ namespace io{
10371037
x += y;
10381038
++col;
10391039
}
1040-
1040+
10411041
if(*col == '.'|| *col == ','){
10421042
++col;
10431043
T pos = 1;
@@ -1054,7 +1054,7 @@ namespace io{
10541054
int e;
10551055

10561056
parse_signed_integer<set_to_max_on_overflow>(col, e);
1057-
1057+
10581058
if(e != 0){
10591059
T base;
10601060
if(e < 0){
@@ -1063,7 +1063,7 @@ namespace io{
10631063
}else{
10641064
base = T(10);
10651065
}
1066-
1066+
10671067
while(e != 1){
10681068
if((e & 1) == 0){
10691069
base = base*base;
@@ -1212,7 +1212,7 @@ namespace io{
12121212
void parse_helper(std::size_t){}
12131213

12141214
template<class T, class ...ColType>
1215-
void parse_helper(std::size_t r, T&t, ColType&...cols){
1215+
void parse_helper(std::size_t r, T&t, ColType&...cols){
12161216
if(row[r]){
12171217
try{
12181218
try{
@@ -1229,7 +1229,7 @@ namespace io{
12291229
parse_helper(r+1, cols...);
12301230
}
12311231

1232-
1232+
12331233
public:
12341234
template<class ...ColType>
12351235
bool read_row(ColType& ...cols){
@@ -1239,17 +1239,17 @@ namespace io{
12391239
"too many columns specified");
12401240
try{
12411241
try{
1242-
1242+
12431243
char*line;
12441244
do{
12451245
line = in.next_line();
12461246
if(!line)
12471247
return false;
12481248
}while(comment_policy::is_comment(line));
1249-
1249+
12501250
detail::parse_line<trim_policy, quote_policy>
12511251
(line, row, col_order);
1252-
1252+
12531253
parse_helper(0, cols...);
12541254
}catch(error::with_file_name&err){
12551255
err.set_file_name(in.get_truncated_file_name());

0 commit comments

Comments
 (0)