]> git.tdb.fi Git - libs/core.git/blobdiff - transcode.cpp
Put examples in their own directory
[libs/core.git] / transcode.cpp
diff --git a/transcode.cpp b/transcode.cpp
deleted file mode 100644 (file)
index 3f4121d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <iostream>
-#include <string>
-#include <msp/stringcodec/codec.h>
-
-using namespace std;
-using namespace Msp;
-
-int main(int argc, char **argv)
-{
-       if(argc<3)
-       {
-               cerr<<"Usage: "<<argv[0]<<" <from-enc> <to-enc>\n";
-               return 1;
-       }
-
-       StringCodec::Codec *from = StringCodec::create_codec(argv[1]);
-       StringCodec::Codec *to = StringCodec::create_codec(argv[2]);
-
-       StringCodec::Decoder *from_dec = from->create_decoder();
-       StringCodec::Encoder *to_enc = to->create_encoder();
-
-       string line;
-       while(getline(cin, line))
-       {
-               line += '\n';
-               StringCodec::ustring ustr;
-               from_dec->decode(line, ustr);
-               string result;
-               to_enc->encode(ustr, result);
-               cout<<result;
-       }
-
-       string result;
-       to_enc->sync(result);
-       cout<<result;
-
-       delete from_dec;
-       delete to_enc;
-       delete from;
-       delete to;
-
-       return 0;
-}