* @brief Get file's EOL type. * @param [in] stats File's text stats. * @return EOL type. */
| 55 | * @return EOL type. |
| 56 | */ |
| 57 | static CRLFSTYLE GetTextFileStyle(const UniMemFile::txtstats & stats) |
| 58 | { |
| 59 | // Check if file has more than one EOL type. |
| 60 | if (!IsTextFileStylePure(stats)) |
| 61 | return CRLFSTYLE::MIXED; |
| 62 | else if (stats.ncrlfs >= stats.nlfs) |
| 63 | { |
| 64 | if (stats.ncrlfs >= stats.ncrs) |
| 65 | return CRLFSTYLE::DOS; |
| 66 | else |
| 67 | return CRLFSTYLE::MAC; |
| 68 | } |
| 69 | else |
| 70 | { |
| 71 | if (stats.nlfs >= stats.ncrs) |
| 72 | return CRLFSTYLE::UNIX; |
| 73 | else |
| 74 | return CRLFSTYLE::MAC; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * @brief Constructor. |
no test coverage detected