- Timestamp:
- 05/22/15 04:15:14 (10 years ago)
- Location:
- cpp
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/stl-util.cpp
r375 r382 12 12 #include <assert.h> 13 13 #ifdef USE_VIRTFILE 14 #include < frams/virtfile/virtfile.h>14 #include <common/virtfile/virtfile.h> 15 15 #endif 16 16 #ifdef __BORLANDC__ -
cpp/common/virtfile/stringfile.cpp
r348 r382 9 9 size_t StringFILE::Vread(void *ptr, size_t size, size_t nmemb) 10 10 { 11 int have = (int)(str.len() - pos);11 int have = int(str.size()) - pos; 12 12 if (have <= 0) return 0; 13 13 int need = (int)(size*nmemb); … … 20 20 int StringFILE::Vgetc() 21 21 { 22 if (pos >= str.len()) //...i znowu byl bug roku! :O22 if (pos >= int(str.size())) 23 23 return EOF; 24 24 else … … 28 28 char *StringFILE::Vgets(char *s, int size) 29 29 { 30 int have = str.len() - (int)pos;30 int have = int(str.size()) - pos; 31 31 if (have <= 0) return 0; 32 32 if (size < 0) size = 0; … … 49 49 case SEEK_SET: pos = offset; break; 50 50 case SEEK_CUR: pos += offset; break; 51 case SEEK_END: pos = str.len() - offset; break;51 case SEEK_END: pos = int(str.size()) - offset; break; 52 52 default: return EINVAL; 53 53 } 54 if (pos < 0) pos = 0; else if (pos >str.len()) pos = str.len();54 if (pos < 0) pos = 0; else if (pos > int(str.size())) pos = int(str.size()); 55 55 return 0; 56 56 } … … 67 67 if ((*mode == 'r') && isStringPath(path)) 68 68 { 69 return new StringFILE2( SString(path + sizeof(PREFIX) - 1));69 return new StringFILE2(string(path + sizeof(PREFIX) - 1)); 70 70 } 71 71 return (chain != NULL) ? chain->Vfopen(path, mode) : NULL; -
cpp/common/virtfile/stringfile.h
r295 r382 7 7 8 8 #include "virtfile.h" 9 #include <frams/util/sstring.h> 9 #include <common/nonstd_stl.h> 10 #include <string.h> 10 11 11 12 class StringFILE : public VirtFILE 12 13 { 13 14 protected: 14 SString& str;15 longpos;15 string& str; 16 int pos; 16 17 public: 17 StringFILE( SString& s): VirtFILE(""), str(s), pos(0) {}18 StringFILE(string& s): VirtFILE(""), str(s), pos(0) {} 18 19 size_t Vread(void *ptr, size_t size, size_t nmemb); 19 20 size_t Vwrite(const void *ptr, size_t size, size_t nmemb) { str.append((const char*)ptr, (int)(size*nmemb)); return size*nmemb; } 20 int Veof() { return pos >= str.len(); }21 int Veof() { return pos >= int(str.size()); } 21 22 int Vputc(int c) { str += (char)c; return c; } 22 23 int Vputs(const char *s) { str.append(s, (int)strlen(s)); return 0; } … … 31 32 class StringFILE2 : public StringFILE 32 33 { 33 SString string;34 string str; 34 35 public: 35 StringFILE2(const SString& s) :StringFILE(string), string(s) {}36 StringFILE2() :StringFILE(str ing) {}37 const SString& getString() { return string; }36 StringFILE2(const string& s) :StringFILE(str), str(s) {} 37 StringFILE2() :StringFILE(str) {} 38 const string& getString() { return str; } 38 39 }; 39 40 -
cpp/frams/Makefile-SDK-files
r375 r382 2 2 3 3 # ALL_DIRS is later expanded by the shell, no spaces/newlines allowed, or it breaks 4 ALL_DIRS={common,frams,frams/canvas,frams/config,frams/loggers,frams/genetics,frams/genetics/f0,frams/genetics/f1,frams/genetics/f2,frams/genetics/f3,frams/genetics/f4,frams/genetics/f5,frams/genetics/f6,frams/genetics/f7,frams/genetics/f8,frams/genetics/f9,frams/genetics/fF,frams/genetics/fT,frams/model,frams/neuro,frams/neuro/impl,frams/param,frams/test,frams/util,frams/vm/classes, frams/virtfile,frams/_demos,frams/model/geometry,frams/_demos/geometry,frams/model/similarity,frams/model/similarity/SVD}4 ALL_DIRS={common,frams,frams/canvas,frams/config,frams/loggers,frams/genetics,frams/genetics/f0,frams/genetics/f1,frams/genetics/f2,frams/genetics/f3,frams/genetics/f4,frams/genetics/f5,frams/genetics/f6,frams/genetics/f7,frams/genetics/f8,frams/genetics/f9,frams/genetics/fF,frams/genetics/fT,frams/model,frams/neuro,frams/neuro/impl,frams/param,frams/test,frams/util,frams/vm/classes,common/virtfile,frams/_demos,frams/model/geometry,frams/_demos/geometry,frams/model/similarity,frams/model/similarity/SVD} 5 5 6 6 GENMANF4=frams/genetics/f4/oper_f4.o … … 25 25 #### sdk_tests 26 26 27 GENOMANIPULATION_OBJS= frams/_demos/genomanipulation.o frams/loggers/loggertostdout.o frams/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)27 GENOMANIPULATION_OBJS= frams/_demos/genomanipulation.o frams/loggers/loggertostdout.o common/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) 28 28 29 MULTILINE_F0_OBJS=frams/_demos/multiline_f0_test.o frams/virtfile/stringfile.o frams/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)29 MULTILINE_F0_OBJS=frams/_demos/multiline_f0_test.o common/virtfile/stringfile.o common/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) 30 30 31 F0_VARIANTS_OBJS=frams/_demos/f0_variants_test.o frams/virtfile/stringfile.o frams/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)31 F0_VARIANTS_OBJS=frams/_demos/f0_variants_test.o common/virtfile/stringfile.o common/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) 32 32 33 LOADER_TEST_OBJS=frams/_demos/genotypeloader.o frams/_demos/loader_test.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)33 LOADER_TEST_OBJS=frams/_demos/genotypeloader.o frams/_demos/loader_test.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) 34 34 35 LOADER_TEST_PARAM_OBJS=frams/_demos/loader_test_param.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o frams/loggers/loggertostdout.o $(SDK_OBJS)35 LOADER_TEST_PARAM_OBJS=frams/_demos/loader_test_param.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o frams/loggers/loggertostdout.o $(SDK_OBJS) 36 36 37 GENOCONV_TEST_OBJS= frams/_demos/genoconv_test.o frams/_demos/printconvmap.o frams/loggers/loggertostdout.o frams/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)37 GENOCONV_TEST_OBJS= frams/_demos/genoconv_test.o frams/_demos/printconvmap.o frams/loggers/loggertostdout.o common/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) 38 38 39 GENO_TEST_OBJS= frams/_demos/geno_test.o frams/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)39 GENO_TEST_OBJS= frams/_demos/geno_test.o common/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) 40 40 41 GENOOPER_TEST_OBJS=frams/_demos/genooper_test.o frams/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)41 GENOOPER_TEST_OBJS=frams/_demos/genooper_test.o common/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) 42 42 43 GENOOPER_TEST_FTEST_OBJS=frams/_demos/genooper_test_fTest.o frams/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) $(GENMAN_FT)43 GENOOPER_TEST_FTEST_OBJS=frams/_demos/genooper_test_fTest.o common/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) $(GENMAN_FT) 44 44 45 NEURO_TEST_OBJS= frams/_demos/neuro_test.o frams/loggers/loggertostdout.o frams/virtfile/virtfile.o \45 NEURO_TEST_OBJS= frams/_demos/neuro_test.o frams/loggers/loggertostdout.o common/virtfile/virtfile.o \ 46 46 frams/neuro/neuroimpl.o frams/neuro/neurofactory.o frams/neuro/impl/neuroimpl-simple.o frams/neuro/impl/neuroimpl-channels.o \ 47 47 frams/neuro/impl/neuroimpl-fuzzy.o frams/neuro/impl/neuroimpl-fuzzy-f0.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) 48 48 49 FULL_PROPS_OBJS= frams/_demos/full_props.o frams/loggers/loggertostdout.o frams/virtfile/virtfile.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)49 FULL_PROPS_OBJS= frams/_demos/full_props.o frams/loggers/loggertostdout.o common/virtfile/virtfile.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) 50 50 51 SHAPECONVERT_OBJS= frams/_demos/shapeconvert.o frams/loggers/loggertostdout.o frams/virtfile/virtfile.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)51 SHAPECONVERT_OBJS= frams/_demos/shapeconvert.o frams/loggers/loggertostdout.o common/virtfile/virtfile.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) 52 52 53 SERIAL_TEST_OBJS= frams/_demos/serial_test.o frams/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)53 SERIAL_TEST_OBJS= frams/_demos/serial_test.o common/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) 54 54 55 PART_SHAPES_OBJS= frams/_demos/part_shapes.o frams/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)55 PART_SHAPES_OBJS= frams/_demos/part_shapes.o common/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) 56 56 57 NEURO_LAYOUT_TEST_OBJS= frams/_demos/neuro_layout_test.o frams/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) frams/canvas/nn_layout_model.o frams/canvas/nn_simple_layout.o frams/canvas/nn_smart_layout.o57 NEURO_LAYOUT_TEST_OBJS= frams/_demos/neuro_layout_test.o common/virtfile/virtfile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) frams/canvas/nn_layout_model.o frams/canvas/nn_simple_layout.o frams/canvas/nn_smart_layout.o 58 58 59 GEOMETRY_INFO_TEST_OBJS=frams/_demos/geometry/info_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS)59 GEOMETRY_INFO_TEST_OBJS=frams/_demos/geometry/info_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS) 60 60 61 GEOMETRY_SURFACE_TEST_OBJS=frams/_demos/geometry/surface_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS)61 GEOMETRY_SURFACE_TEST_OBJS=frams/_demos/geometry/surface_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS) 62 62 63 GEOMETRY_VOLUME_TEST_OBJS=frams/_demos/geometry/volume_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS)63 GEOMETRY_VOLUME_TEST_OBJS=frams/_demos/geometry/volume_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS) 64 64 65 GEOMETRY_APICES_TEST_OBJS=frams/_demos/geometry/apices_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS)65 GEOMETRY_APICES_TEST_OBJS=frams/_demos/geometry/apices_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS) 66 66 67 67 SIMIL_TEST_OBJS=frams/_demos/simil_test.o frams/model/similarity/SVD/lapack.o frams/model/similarity/SVD/matrix_tools.o frams/model/similarity/simil_match.o frams/model/similarity/simil_model.o \ 68 frams/_demos/genotypeloader.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)68 frams/_demos/genotypeloader.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o frams/loggers/loggertostdout.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) 69 69 70 70 SIMIL_UNITTESTS_OBJS=frams/_demos/simil_unittests.o frams/model/similarity/simil_match.o -
cpp/frams/_demos/f0_variants_test.cpp
r375 r382 6 6 #include <stdio.h> 7 7 #include <time.h> 8 #include < frams/virtfile/stdiofile.h>8 #include <common/virtfile/stdiofile.h> 9 9 10 10 #include <frams/genetics/defgenoconv.h> -
cpp/frams/_demos/full_props.cpp
r375 r382 6 6 #include <stdio.h> 7 7 #include <time.h> 8 #include < frams/virtfile/stdiofile.h>8 #include <common/virtfile/stdiofile.h> 9 9 10 10 #include <frams/model/model.h> -
cpp/frams/_demos/geno_test.cpp
r375 r382 3 3 // See LICENSE.txt for details. 4 4 5 #include < frams/virtfile/stdiofile.h>5 #include <common/virtfile/stdiofile.h> 6 6 #include <frams/util/sstringutils.h> 7 7 #include <frams/genetics/preconfigured.h> -
cpp/frams/_demos/genomanipulation.cpp
r375 r382 6 6 #include <stdio.h> 7 7 #include <time.h> 8 #include < frams/virtfile/stdiofile.h>8 #include <common/virtfile/stdiofile.h> 9 9 10 10 #include <frams/model/model.h> -
cpp/frams/_demos/geometry/geometrytestutils.cpp
r348 r382 6 6 7 7 #include "../genotypeloader.h" 8 #include < frams/virtfile/stdiofile.h>8 #include <common/virtfile/stdiofile.h> 9 9 #include <math.h> 10 10 #include <stdio.h> -
cpp/frams/_demos/loader_test.cpp
r348 r382 4 4 5 5 #include "genotypeloader.h" 6 #include < frams/virtfile/stdiofile.h>6 #include <common/virtfile/stdiofile.h> 7 7 8 8 /** -
cpp/frams/_demos/loader_test_param.cpp
r375 r382 4 4 5 5 #include <frams/param/multiparamload.h> 6 #include < frams/virtfile/stdiofile.h>6 #include <common/virtfile/stdiofile.h> 7 7 #include <frams/loggers/loggertostdout.h> 8 8 -
cpp/frams/_demos/multiline_f0_test.cpp
r375 r382 6 6 #include <stdio.h> 7 7 #include <time.h> 8 #include < frams/virtfile/stdiofile.h>8 #include <common/virtfile/stdiofile.h> 9 9 10 10 #include <frams/genetics/preconfigured.h> 11 11 #include <frams/model/model.h> 12 12 #include <frams/loggers/loggertostdout.h> 13 #include < frams/virtfile/stringfile.h>13 #include <common/virtfile/stringfile.h> 14 14 15 15 int main(int argc,char*argv[]) -
cpp/frams/_demos/neuro_layout_test.cpp
r375 r382 3 3 // See LICENSE.txt for details. 4 4 5 #include < frams/virtfile/stdiofile.h>5 #include <common/virtfile/stdiofile.h> 6 6 #include <frams/util/sstringutils.h> 7 7 #include <frams/genetics/preconfigured.h> -
cpp/frams/_demos/neuro_test.cpp
r375 r382 4 4 5 5 #include <frams/genetics/geno.h> 6 #include < frams/virtfile/stdiofile.h>6 #include <common/virtfile/stdiofile.h> 7 7 #include <frams/util/sstringutils.h> 8 8 #include <frams/genetics/preconfigured.h> -
cpp/frams/_demos/shapeconvert.cpp
r375 r382 6 6 #include <stdio.h> 7 7 #include <time.h> 8 #include < frams/virtfile/stdiofile.h>8 #include <common/virtfile/stdiofile.h> 9 9 10 10 #include <frams/model/model.h> -
cpp/frams/_demos/simil_test.cpp
r375 r382 8 8 #include "frams/_demos/genotypeloader.h" 9 9 #include "frams/genetics/preconfigured.h" 10 #include " frams/virtfile/stdiofile.h"10 #include "common/virtfile/stdiofile.h" 11 11 #include "frams/model/similarity/simil_model.h" 12 12 -
cpp/frams/loggers/loggertostdout.h
r378 r382 7 7 8 8 #include "loggers.h" 9 #include < frams/virtfile/virtfile.h>9 #include <common/virtfile/virtfile.h> 10 10 11 11 class LoggerToStdout : public LoggerBase -
cpp/frams/param/multiparamload.h
r333 r382 8 8 #include <stdio.h> 9 9 #include "param.h" 10 #include < frams/virtfile/virtfile.h>10 #include <common/virtfile/virtfile.h> 11 11 #include <frams/util/extvalue.h> 12 12 -
cpp/frams/param/param.h
r375 r382 11 11 #include <frams/util/list.h> 12 12 #include <frams/util/statrick.h> 13 #include < frams/virtfile/virtfile.h>13 #include <common/virtfile/virtfile.h> 14 14 #include <common/log.h> 15 15 -
cpp/frams/util/sstringutils.cpp
r375 r382 4 4 5 5 #include "sstringutils.h" 6 #include < frams/virtfile/virtfile.h>6 #include <common/virtfile/virtfile.h> 7 7 #include <common/log.h> 8 8 #include <common/nonstd.h> -
cpp/frams/util/sstringutils.h
r286 r382 7 7 8 8 #include "sstring.h" 9 #include < frams/virtfile/virtfile.h>9 #include <common/virtfile/virtfile.h> 10 10 11 11 /// return: 1=ok 0=error -
cpp/frams/vm/framscript.l
r348 r382 76 76 if (end) 77 77 { 78 trctx.tmp+= SString(yytext,end-yytext);79 framscriptlval.setString(quoteMultiline( trctx.tmp));78 trctx.tmp+=string(yytext,end-yytext); 79 framscriptlval.setString(quoteMultiline(SString(trctx.tmp.c_str()))); 80 80 yyless((end-yytext)+3); 81 81 BEGIN 0; … … 83 83 } 84 84 else 85 trctx.tmp+= SString(yytext,yyleng);85 trctx.tmp+=string(yytext,yyleng); 86 86 } 87 87 <multiline>\n {trctx.line++; trctx.linechanged=true; trctx.tmp+="\n";} -
cpp/frams/vm/framscript.y
r375 r382 526 526 trstack.adjust(+1); 527 527 } 528 trctx.tmp= 0;528 trctx.tmp=""; 529 529 trctx.divertOut(); 530 530 //trctx.out->printf("# expr#3\n"); … … 535 535 if (!$7.constant) { trctx.out->printf("inc m0\n"); trstack.adjust(+1); } 536 536 trctx.restoreOut(); 537 $$.setString(trctx.tmp );537 $$.setString(trctx.tmp.c_str()); 538 538 //trctx.out->printf("# pseudoblok_statement pos=%d\n",trstack.currentPos()); 539 539 }
Note: See TracChangeset
for help on using the changeset viewer.