File: html2CString

package info (click to toggle)
quickplot 0.8.6-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,544 kB
  • ctags: 1,019
  • sloc: cpp: 10,051; sh: 7,597; makefile: 176
file content (23 lines) | stat: -rwxr-xr-x 342 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh

if [ "$1" = "" ]
then
  echo "Usage: cat FILE.html | $0 FILE_html.cpp"
  exit 1
fi


echo "// $1  Generated by running: cat ${1%_html.cpp}.html | $0 $*" > $1

echo >> $1

echo "const char *${1%.cpp} = " >> $1

while read a
do
  echo -n "\"" >> $1
  echo -n $a | sed -e 's/"/\\\"/g' >> $1
  echo "\\n\"" >> $1
done

echo ";" >> $1