2from typing
import Optional
5def _to_unix(s: str) -> str:
6 if s.find(
"\r\n") == -1:
9 return s.replace(
"\r\n",
"\n")
24 return cls(content.encode(
"utf-8"))
26 def __detect_newline_type(self) -> bool:
27 first_line = self.
__buffer.readline()
29 return b
"\r\n" not in first_line
35 line_bytes = self.
__buffer.readline()
40 line = line_bytes.decode(
"utf-8")
int get_line_number(self)
__init__(self, bytes content)
for_binary(cls, bytes content)
bool __detect_newline_type(self)
for_string(cls, str content)
Optional[str] read_line(self)