ReactOS 0.4.15-dev-5664-g3bf4ef6
utf16le.cpp File Reference
#include <fstream>
#include <iostream>
#include <string.h>
Include dependency graph for utf16le.cpp:

Go to the source code of this file.

Classes

class  utf_converter
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Definition at line 275 of file utf16le.cpp.

276{
278
279 if (argc < 3)
280 {
281 cout << "usage: " << argv[0] << " inputfile outputfile" << endl;
282 return -1;
283 }
284
286
287 if (argc == 4 && strcasecmp(argv[3], "nobom") == 0)
288 {
289 bom_type = utf_converter::nobom;
290 }
291
292 utf_converter conv(argv[1], argv[2], bom_type);
293
294 if ((err = conv.getError())!=utf_converter::none)
295 {
296 switch (err)
297 {
299 cerr << "Couldn't open input file." << endl;
300 break;
302 cerr << "Couldn't open output file." << endl;
303 break;
304 default:
305 cerr << "Unknown error." << endl;
306 }
307 return -1;
308 }
309 else
310 {
311 conv.convert2utf16le();
312 }
313
314 return 0;
315}
static int argc
Definition: ServiceArgs.c:12
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
Definition: _ostream.h:357
#define strcasecmp
Definition: fake.h:9
#define cout
Definition: iostream.cpp:38
#define cerr
Definition: iostream.cpp:39
#define argv
Definition: mplay32.c:18
#define err(...)