mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-15 09:54:17 +00:00
Last commit before tagging and releasing
This commit is contained in:
13
extras/imported/c-mode/Idioms/read file (readF).yasnippet
Normal file
13
extras/imported/c-mode/Idioms/read file (readF).yasnippet
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: readfile
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Read File Into Vector
|
||||
# --
|
||||
std::vector<char> v;
|
||||
if(FILE${TM_C_POINTER: *}fp = fopen(${1:"filename"}, "r"))
|
||||
{
|
||||
char buf[1024];
|
||||
while(size_t len = fread(buf, 1, sizeof(buf), fp))
|
||||
v.insert(v.end(), buf, buf + len);
|
||||
fclose(fp);
|
||||
}
|
||||
Reference in New Issue
Block a user