Beispiel #1
0
        private string GetWriteFuncText()
        {
            SizeOfTypes sizeOfTypes = new SizeOfTypes();

            return("public static void " + this._nameFuncToWrite + "int index, string type, string data)" +
                   "{" +
                   "switch(type)" +
                   "{" +
                   "case \"int\": {" +
                   "mas[index] = Int32.Parse(data);" +
                   "break;" +
                   "}" +

                   "case \"string\": {" +

                   "for(int i=0;i<" + sizeOfTypes.GetSizeOfType("string") + "; i++)" +
                   "{" +
                   "mas[index + i] = -1;" +
                   "}" +

                   "int letterIndex=0;" +
                   "foreach(char letter in data)" +
                   "{" +
                   "mas[index + letterIndex] = (int)letter;" +
                   "letterIndex++;" +
                   "}" +
                   "break;" +
                   "}" +
                   "}" +

                   "}\n");
        }
Beispiel #2
0
        private string GetReadStringFuncText()
        {
            SizeOfTypes sizeOfTypes = new SizeOfTypes();

            return("public static string " + this._nameFuncToReadString + "int index) {\n" +
                   "string str=\"\";\n" +
                   "for(int i=0;i<" + sizeOfTypes.GetSizeOfType("string") + "; i++)\n" +
                   "{\n" +
                   "if(mas[index + i] != -1)\n" +
                   "{\n" +
                   "str += ((char)mas[index + i]).ToString();\n" +
                   "}\n" +
                   "else\n" +
                   "{\n" +
                   "return str;\n" +
                   "}\n" +
                   "}\n" +
                   "return str;\n" +
                   "}\n");
        }
Beispiel #3
0
        private string GetReadStringFuncText()
        {
            SizeOfTypes sizeOfTypes = new SizeOfTypes();

            return "public static string " + this._nameFuncToReadString + "int index) {\n" +
                        "string str=\"\";\n" +
                        "for(int i=0;i<" + sizeOfTypes.GetSizeOfType("string") + "; i++)\n" +
                        "{\n" +
                            "if(mas[index + i] != -1)\n" +
                            "{\n" +
                                "str += ((char)mas[index + i]).ToString();\n" +
                            "}\n" +
                            "else\n" +
                            "{\n" +
                                "return str;\n" +
                            "}\n" +
                        "}\n" +
                        "return str;\n" +
                   "}\n";
        }
Beispiel #4
0
        private string GetWriteFuncText()
        {
            SizeOfTypes sizeOfTypes = new SizeOfTypes();

            return "public static void " + this._nameFuncToWrite + "int index, string type, string data)" +
            "{" +
                "switch(type)" +
                "{" +
                    "case \"int\": {" +
                        "mas[index] = Int32.Parse(data);" +
                        "break;" +
                    "}" +

                    "case \"string\": {" +

                        "for(int i=0;i<"+ sizeOfTypes.GetSizeOfType("string") +"; i++)" +
                        "{" +
                            "mas[index + i] = -1;" +
                        "}" +

                        "int letterIndex=0;" +
                        "foreach(char letter in data)" +
                        "{" +
                            "mas[index + letterIndex] = (int)letter;" +
                            "letterIndex++;"+
                        "}" +
                        "break;" +
                    "}" +
                "}" +

            "}\n";
        }