Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FilesystemInterface_t support #7

Closed
wants to merge 1 commit into from
Closed

Add FilesystemInterface_t support #7

wants to merge 1 commit into from

Conversation

danopernis
Copy link

Not my proudest merge request. There is plenty of naked pointers and quirks from the era before c++11. Code is not tested yet (there are no automated tests) but basic shape of the code is there and ready for review :)

fboranek pushed a commit to fboranek/teng that referenced this pull request Sep 14, 2018
…s render fine. E.g. when include in-memmory-common-head.html:

…/templates/in-memmory-common-head.html(1,0) Error: Cannot stat file ‘…/templates/in-memmory-common-head.html' (No such file or directory)

(gdb) bt
#0  Teng::FileStat_t::stat (this=0x7fffffe85510, pos=..., err=...) at tengsourcelist.cc:56
seznam#1  0x00007ffff7b237ce in Teng::SourceList_t::addSource (this=0x637178, _source=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>, pos=..., err=...) at tengsourcelist.cc:101
seznam#2  0x00007ffff7b6245a in Teng::Program_t::addSource (pos=..., source="/Volumes/UserData/workspace/github.com/teng-example/build/templates/in-memmory-common-head.html", this=<optimized out>) at tengprogram.h:86
seznam#3  Teng::tengSyntax_parse (context=context@entry=0x7fffffffdfe0) at tengsyntax.yy:551
seznam#4  0x00007ffff7b30743 in Teng::ParserContext_t::createProgramFromString (this=0x7fffffffdfe0, str=...) at tengparsercontext.cc:192
seznam#5  0x00007ffff7b5ca63 in Teng::TemplateCache_t::createTemplate (this=0x638ba8, templateSource=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>, langFilename="",
    configFilename="\320\236\335\367\377\177\000\000hcc", '\000' <repeats 38 times>, sourceType=Teng::TemplateCache_t::SRC_FILE, sourceType@entry=Teng::TemplateCache_t::SRC_STRING) at tengtemplate.cc:115
seznam#6  0x00007ffff7b1c602 in Teng::Teng_t::generatePage (this=0x7fffffffe960,
    templateString="\n<html>\n<?teng include file=\"in-memmory-common-head.html\" ?>\n    <body>\n        <?teng frag row?><p>${rnum}\n", ' ' <repeats 12 times>, "<?teng frag col?>${cnum} <?teng endfrag?>\n        </p><?teng endfrag?>\n    </bod"..., dict=..., lang="", param="", scontentType=..., encoding="utf-8", data=..., writer=..., err=...) at teng.cc:224
seznam#7  0x0000000000402d34 in generate (teng=...,
    templ="\n<html>\n<?teng include file=\"in-memmory-common-head.html\" ?>\n    <body>\n        <?teng frag row?><p>${rnum}\n", ' ' <repeats 12 times>, "<?teng frag col?>${cnum} <?teng endfrag?>\n        </p><?teng endfrag?>\n    </bod"..., root=...) at /Volumes/UserData/workspace/github.com/teng-example/cpp/teng_utils.h:46
seznam#8  0x0000000000402153 in main (argc=1, argv=0x7fffffffeac8) at /Volumes/UserData/workspace/github.com/teng-example/cpp/teng_filesystem.cc:47
fboranek pushed a commit to fboranek/teng that referenced this pull request Sep 14, 2018
…s render fine. E.g. when include in-memmory-common-head.html:

…/templates/in-memmory-common-head.html(1,0) Error: Cannot stat file ‘…/templates/in-memmory-common-head.html' (No such file or directory)

(gdb) bt
#0  Teng::FileStat_t::stat (this=0x7fffffe85510, pos=..., err=...) at tengsourcelist.cc:56
seznam#1  0x00007ffff7b237ce in Teng::SourceList_t::addSource (this=0x637178, _source=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>, pos=..., err=...) at tengsourcelist.cc:101
seznam#2  0x00007ffff7b6245a in Teng::Program_t::addSource (pos=..., source="/Volumes/UserData/workspace/github.com/teng-example/build/templates/in-memmory-common-head.html", this=<optimized out>) at tengprogram.h:86
seznam#3  Teng::tengSyntax_parse (context=context@entry=0x7fffffffdfe0) at tengsyntax.yy:551
seznam#4  0x00007ffff7b30743 in Teng::ParserContext_t::createProgramFromString (this=0x7fffffffdfe0, str=...) at tengparsercontext.cc:192
seznam#5  0x00007ffff7b5ca63 in Teng::TemplateCache_t::createTemplate (this=0x638ba8, templateSource=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>, langFilename="",
    configFilename="\320\236\335\367\377\177\000\000hcc", '\000' <repeats 38 times>, sourceType=Teng::TemplateCache_t::SRC_FILE, sourceType@entry=Teng::TemplateCache_t::SRC_STRING) at tengtemplate.cc:115
seznam#6  0x00007ffff7b1c602 in Teng::Teng_t::generatePage (this=0x7fffffffe960,
    templateString="\n<html>\n<?teng include file=\"in-memmory-common-head.html\" ?>\n    <body>\n        <?teng frag row?><p>${rnum}\n", ' ' <repeats 12 times>, "<?teng frag col?>${cnum} <?teng endfrag?>\n        </p><?teng endfrag?>\n    </bod"..., dict=..., lang="", param="", scontentType=..., encoding="utf-8", data=..., writer=..., err=...) at teng.cc:224
seznam#7  0x0000000000402d34 in generate (teng=...,
    templ="\n<html>\n<?teng include file=\"in-memmory-common-head.html\" ?>\n    <body>\n        <?teng frag row?><p>${rnum}\n", ' ' <repeats 12 times>, "<?teng frag col?>${cnum} <?teng endfrag?>\n        </p><?teng endfrag?>\n    </bod"..., root=...) at /Volumes/UserData/workspace/github.com/teng-example/cpp/teng_utils.h:46
seznam#8  0x0000000000402153 in main (argc=1, argv=0x7fffffffeac8) at /Volumes/UserData/workspace/github.com/teng-example/cpp/teng_filesystem.cc:47
fboranek pushed a commit to fboranek/teng that referenced this pull request Sep 14, 2018
…s render fine. E.g. when include in-memmory-common-head.html:

…/templates/in-memmory-common-head.html(1,0) Error: Cannot stat file ‘…/templates/in-memmory-common-head.html' (No such file or directory)

(gdb) bt
#0  Teng::FileStat_t::stat (this=0x7fffffe85510, pos=..., err=...) at tengsourcelist.cc:56
seznam#1  0x00007ffff7b237ce in Teng::SourceList_t::addSource (this=0x637178, _source=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>, pos=..., err=...) at tengsourcelist.cc:101
seznam#2  0x00007ffff7b6245a in Teng::Program_t::addSource (pos=..., source="/Volumes/UserData/workspace/github.com/teng-example/build/templates/in-memmory-common-head.html", this=<optimized out>) at tengprogram.h:86
seznam#3  Teng::tengSyntax_parse (context=context@entry=0x7fffffffdfe0) at tengsyntax.yy:551
seznam#4  0x00007ffff7b30743 in Teng::ParserContext_t::createProgramFromString (this=0x7fffffffdfe0, str=...) at tengparsercontext.cc:192
seznam#5  0x00007ffff7b5ca63 in Teng::TemplateCache_t::createTemplate (this=0x638ba8, templateSource=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>, langFilename="",
    configFilename="\320\236\335\367\377\177\000\000hcc", '\000' <repeats 38 times>, sourceType=Teng::TemplateCache_t::SRC_FILE, sourceType@entry=Teng::TemplateCache_t::SRC_STRING) at tengtemplate.cc:115
seznam#6  0x00007ffff7b1c602 in Teng::Teng_t::generatePage (this=0x7fffffffe960,
    templateString="\n<html>\n<?teng include file=\"in-memmory-common-head.html\" ?>\n    <body>\n        <?teng frag row?><p>${rnum}\n", ' ' <repeats 12 times>, "<?teng frag col?>${cnum} <?teng endfrag?>\n        </p><?teng endfrag?>\n    </bod"..., dict=..., lang="", param="", scontentType=..., encoding="utf-8", data=..., writer=..., err=...) at teng.cc:224
seznam#7  0x0000000000402d34 in generate (teng=...,
    templ="\n<html>\n<?teng include file=\"in-memmory-common-head.html\" ?>\n    <body>\n        <?teng frag row?><p>${rnum}\n", ' ' <repeats 12 times>, "<?teng frag col?>${cnum} <?teng endfrag?>\n        </p><?teng endfrag?>\n    </bod"..., root=...) at /Volumes/UserData/workspace/github.com/teng-example/cpp/teng_utils.h:46
seznam#8  0x0000000000402153 in main (argc=1, argv=0x7fffffffeac8) at /Volumes/UserData/workspace/github.com/teng-example/cpp/teng_filesystem.cc:47
@burlog
Copy link
Contributor

burlog commented Oct 15, 2018

There is another implementation of this feature.

@burlog burlog closed this Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants