ReactOS  0.4.15-dev-1054-gd029a62
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[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

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
#define strcasecmp
Definition: fake.h:9
#define argv
Definition: mplay32.c:18
#define cout
Definition: iostream.cpp:38
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
Definition: _ostream.h:357
_STLP_DECLSPEC _Stl_aligned_buffer< ostream > cerr
Definition: iostream.cpp:102
#define err(...)