MCPcopy Create free account
hub / github.com/davisking/dlib / read_int

Function read_int

tools/imglab/src/convert_idl.cpp:24–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 }
23
24 int read_int(std::istream& in)
25 {
26 bool is_neg = false;
27 if (in.peek() == '-')
28 {
29 is_neg = true;
30 in.get();
31 }
32 if (in.peek() == '+')
33 in.get();
34
35 int val = 0;
36 while ('0' <= in.peek() && in.peek() <= '9')
37 {
38 val = 10*val + in.get()-'0';
39 }
40
41 if (is_neg)
42 return -val;
43 else
44 return val;
45 }
46
47// ----------------------------------------------------------------------------------------
48

Callers 1

parse_annotation_fileFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected