1 /* 2 * This file is part of wxSmith plugin for Code::Blocks Studio 3 * Copyright (C) 2006-2007 Bartlomiej Swiecki 4 * 5 * wxSmith is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * wxSmith is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with wxSmith. If not, see <http://www.gnu.org/licenses/>. 17 * 18 * $Revision: 10686 $ 19 * $Id: wxscodinglang.h 10686 2016-01-22 10:53:43Z mortenmacfly $ 20 * $HeadURL: svn://svn.code.sf.net/p/codeblocks/code/branches/release-20.xx/src/plugins/contrib/wxSmith/wxscodinglang.h $ 21 */ 22 23 #ifndef WXSCODINGLANG_H 24 #define WXSCODINGLANG_H 25 26 #include <wx/string.h> 27 28 /** \brief This enumeration contains all coding languages supported in wxSmith */ 29 enum wxsCodingLang 30 { 31 wxsCPP = 0x0001, 32 wxsUnknownLanguage = 0x8000 33 }; 34 35 /** \brief Namespace with useful common functions for supported coding languages */ 36 namespace wxsCodeMarks 37 { 38 /** \brief Getting wxString name of coding language */ 39 wxString Name(wxsCodingLang Id); 40 41 /** \brief Getting id of coding language's name */ 42 wxsCodingLang Id(const wxString& Name); 43 44 /** \brief Getting coding language from file's extension */ 45 wxsCodingLang IdFromExt(const wxString& Extension); 46 47 /** \brief Helper function for generating block begin */ 48 wxString Beg(wxsCodingLang Lang,const wxString& BlockName); 49 50 /** \brief Helper function for generating block begin */ 51 wxString Beg(wxsCodingLang Lang,const wxString& BlockName,const wxString& Param); 52 53 /** \brief Helper function for generating block end */ 54 wxString End(wxsCodingLang Lang); 55 56 /** \brief Converting given string into representation of string in source code */ 57 wxString String(wxsCodingLang Lang,const wxString& Source); 58 59 /** \brief Converting given string into Wx-like representation */ 60 wxString WxString(wxsCodingLang Lang,const wxString& Source,bool WithTranslation); 61 62 /** \brief Checking if given string can be valid identifier in selected language 63 * (can be name of variable) 64 */ 65 bool ValidateIdentifier(wxsCodingLang Lang,const wxString& Identifier); 66 67 /** \brief Posting notification message about unknown coding language */ 68 void Unknown(const wxString& Function,wxsCodingLang Lang); 69 } 70 71 #endif 72