Definition at line 22 of file res2cc_cmd.py.
def res2cc_cmd.File.__init__ |
( |
|
self, |
|
|
|
directory, |
|
|
|
subdir, |
|
|
|
fileName, |
|
|
|
mode |
|
) |
| |
Definition at line 23 of file res2cc_cmd.py.
23 def __init__(self,directory,subdir,fileName,mode):
27 filePath = join(directory,subdir,fileName)
int open(const char *, int)
Opens a file descriptor.
def __init__(self, directory, subdir, fileName, mode)
def res2cc_cmd.File.convertToBytes |
( |
|
self, |
|
|
|
outputFile |
|
) |
| |
Definition at line 48 of file res2cc_cmd.py.
49 lines = [x
for x
in self.inputFile.readlines()
if not x.startswith(
'#')]
50 w,h = (
int(x)
for x
in lines[0].
split())
51 data =
"".join(map(chr,[
int(w>>8),
int(w&0xFF),
int(h>>8),
int(h&0xFF)]+
52 [
int(x)
for line
in lines[1:]
for x
in line.split()]))
def writeBytes(self, data, outputFile)
def convertToBytes(self, outputFile)
void split(std::string const &s, char c, OutIter dest)
def res2cc_cmd.File.factory |
( |
|
directory, |
|
|
|
subdir, |
|
|
|
fname |
|
) |
| |
|
static |
Definition at line 56 of file res2cc_cmd.py.
57 ext = splitext(fname)[1]
58 if ext==
'.lum':
return LumFile(directory,subdir,fname)
59 if ext==
'.luma':
return LumaFile(directory,subdir,fname)
60 if ext==
'.css':
return CSSFile(directory,subdir,fname)
def factory(directory, subdir, fname)
def res2cc_cmd.File.formatByte |
( |
|
self, |
|
|
|
byte |
|
) |
| |
Definition at line 32 of file res2cc_cmd.py.
33 if isinstance(byte,int):
36 return format(ord(byte),
'02x')
def formatByte(self, byte)
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
def res2cc_cmd.File.writeBytes |
( |
|
self, |
|
|
|
data, |
|
|
|
outputFile |
|
) |
| |
Definition at line 38 of file res2cc_cmd.py.
40 print(
"static const unsigned char %s_data[] = " % self.
bareName,file=outputFile)
41 print(
"{",file=outputFile)
42 lines = [data[x:x+bytes_per_line]
for x
in range(0,len(data),bytes_per_line)]
43 linesAsString =
',\n '.join([
', '.join([
'0x'+self.
formatByte(byte)
for byte
in line])
for line
in lines])
44 print(
' %s' % linesAsString,file=outputFile)
45 print(
"};",file=outputFile)
46 print(
"const int %s_len = %d;\n" % (self.
bareName,len(data)),file=outputFile)
def formatByte(self, byte)
def writeBytes(self, data, outputFile)
res2cc_cmd.File.directory |
res2cc_cmd.File.inputFile |
The documentation for this class was generated from the following file: