Tous les collages #14931 Brut Modifier

Text2PhoneConv

public cpp v1 · immuable
#14931 ·publié 2005-06-18 04:45 UTC
corps du collage affiché
/*************************************************************************************************************************************************** * * Text 2 Phone Convert Version 0.1 [ALPHA] * *  * (C) 2005 Tyler "Tristor" Duzan	Written June 17, 2005 * * Purpose: * * After a short conversation with Chewie[] on #bs@MozNET, I decided to write a small application that converts text to numbers based * on the same system used by cell phones/touchtone phones.  The specification I am going to follow for this is fairly loose at the moment * because I haven't put all the time needed into thinking this out.  I am just going to whip this up as a starter.  I think this might be  * fun to toy around with as well as have other possible uses.  I don't anticipate this to be used for communication that is somewhat masked in  * similar fashions to 'ong' because I have not written a 'descrambler'.  I suppose I will eventually have to write one, but it is a bit of a big * undertaking, especially considering my relative inexperience with this sort of thing. * * Specification: * * The layout of the standard touchtone phone keypad follows the following: * * 1 = NULL/Padding * 2 = ABC * 3 = DEF * 4 = GHI * 5 = JKL * 6 = MNO * 7 = PQRS * 8 = TUV * 9 = WXYZ * 0 = NULL/Padding *  * This differs from the standard cellular phone keypad which follows this: * * 1 = .@?!-,&:' and <RETURN> * 2 = ABC * 3 = DEF * 4 = GHI * 5 = JKL * 6 = MNO * 7 = PQRS * 8 = TUV * 9 = WXYZ * 0 = <SPACE> and [] (unicode blocky character) * * One thing that occurs on both of them is that each number also represents itself, so on a cell phone, if you hit 1 enough in a text message, * you will eventually have it show a 1 on the screen. * * I wish to follow this specification on how to do things: * * 1 = <SPACE>, NULL/Padding * 2 = ABC * 3 = DEF * 4 = GHI * 5 = JKL * 6 = MNO * 7 = PQRS * 8 = TUV * 9 = WXYZ * 0 = Anything that doesn't fit above * * * So, using my specification, an example message that looks like (without quotes), "My name is Jane, I like to goto parties.  I think they are fun." * would be converted to:  "691626314715263014154531861468617278437011418446518439127313860".  I think this is fairly easily workable, although I have * yet to figure out exactly how I am going to implement this. * * * ChangeLog: * * v0.1/20050617:  Created the header/comment block at the top of the source file.  Decided to wait an mull over my options for implementation. * * * * * * 	This file is part of Text 2 Phone Convert. * *  Text 2 Phone Convert is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  Text 2 Phone Convert is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with Text 2 Phone Convert; if not, write to the Free Software *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA ***************************************************************************************************************************************************/