Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: experimental/PdfViewer/generate_code.py

Issue 18103009: remove const for int scalar types (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 2
3 import sys 3 import sys
4 4
5 import datatypes 5 import datatypes
6 from autogen.pdfspec_autogen import * 6 from autogen.pdfspec_autogen import *
7 7
8 knowTypes = { 8 knowTypes = {
9 '(any)': ['SkPdfObject*', 'SkPdfObjectFromDictionary', datatypes.CppNull(), 'tru e', 'use a mapper'], 9 '(any)': ['SkPdfObject*', 'SkPdfObjectFromDictionary', datatypes.CppNull(), 'tru e', 'use a mapper'],
10 '(undefined)': ['SkPdfObject*', 'SkPdfObjectFromDictionary', datatypes.CppNull() , 'true', 'use a mapper'], 10 '(undefined)': ['SkPdfObject*', 'SkPdfObjectFromDictionary', datatypes.CppNull() , 'true', 'use a mapper'],
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 .carbonCopyPublicPodofo('double value() const;')\ 632 .carbonCopyPublicPodofo('double value() const;')\
633 .carbonCopyPublicPodofoCpp('double SkPdfNumber::val ue() const {return podofo()->GetReal();}')\ 633 .carbonCopyPublicPodofoCpp('double SkPdfNumber::val ue() const {return podofo()->GetReal();}')\
634 634
635 manager.addClass('Name').check('podofoObj->GetDataType() == PoDoFo::ePdfDataTy pe_Name')\ 635 manager.addClass('Name').check('podofoObj->GetDataType() == PoDoFo::ePdfDataTy pe_Name')\
636 .carbonCopyPublicPodofo('const std::string& value() const;')\ 636 .carbonCopyPublicPodofo('const std::string& value() const;')\
637 .carbonCopyPublicPodofoCpp('const std::string& SkPd fName::value() const {return podofo()->GetName().GetName();}') 637 .carbonCopyPublicPodofoCpp('const std::string& SkPd fName::value() const {return podofo()->GetName().GetName();}')
638 638
639 manager.addClass('Reference').check('podofoObj->GetDataType() == PoDoFo::ePdfD ataType_Reference') 639 manager.addClass('Reference').check('podofoObj->GetDataType() == PoDoFo::ePdfD ataType_Reference')
640 640
641 manager.addClass('Array').check('podofoObj->GetDataType() == PoDoFo::ePdfDataT ype_Array')\ 641 manager.addClass('Array').check('podofoObj->GetDataType() == PoDoFo::ePdfDataT ype_Array')\
642 .carbonCopyPublicPodofo('const int size() const;')\ 642 .carbonCopyPublicPodofo('int size() const;')\
643 .carbonCopyPublicPodofoCpp('const int SkPdfArray::s ize() const {return podofo()->GetArray().GetSize();}')\ 643 .carbonCopyPublicPodofoCpp('int SkPdfArray::size() const {return podofo()->GetArray().GetSize();}')\
644 .carbonCopyPublicPodofo('SkPdfObject* operator[](in t i) const;')\ 644 .carbonCopyPublicPodofo('SkPdfObject* operator[](in t i) const;')\
645 .carbonCopyPublicPodofoCpp('SkPdfObject* SkPdfArray ::operator[](int i) const { SkPdfObject* ret = NULL; fParsedDoc->mapper()->mapO bject(&podofo()->GetArray()[i], &ret); return ret; }') 645 .carbonCopyPublicPodofoCpp('SkPdfObject* SkPdfArray ::operator[](int i) const { SkPdfObject* ret = NULL; fParsedDoc->mapper()->mapO bject(&podofo()->GetArray()[i], &ret); return ret; }')
646 646
647 manager.addClass('String').check('podofoObj->GetDataType() == PoDoFo::ePdfData Type_String || podofoObj->GetDataType() == PoDoFo::ePdfDataType_HexString')\ 647 manager.addClass('String').check('podofoObj->GetDataType() == PoDoFo::ePdfData Type_String || podofoObj->GetDataType() == PoDoFo::ePdfDataType_HexString')\
648 .carbonCopyPublicPodofo('const std::string& value() const;')\ 648 .carbonCopyPublicPodofo('const std::string& value() const;')\
649 .carbonCopyPublicPodofoCpp('const std::string& SkPdf String::value() const {return podofo()->GetString().GetStringUtf8();}')\ 649 .carbonCopyPublicPodofoCpp('const std::string& SkPdf String::value() const {return podofo()->GetString().GetStringUtf8();}')\
650 .carbonCopyPublicPodofo('const char* c_str() const;' )\ 650 .carbonCopyPublicPodofo('const char* c_str() const;' )\
651 .carbonCopyPublicPodofoCpp('const char* SkPdfString: :c_str() const {return podofo()->GetString().GetString();}')\ 651 .carbonCopyPublicPodofoCpp('const char* SkPdfString: :c_str() const {return podofo()->GetString().GetString();}')\
652 .carbonCopyPublicPodofo('size_t len() const;')\ 652 .carbonCopyPublicPodofo('size_t len() const;')\
653 .carbonCopyPublicPodofoCpp('size_t SkPdfString::len( ) const {return podofo()->GetString().GetLength();}') 653 .carbonCopyPublicPodofoCpp('size_t SkPdfString::len( ) const {return podofo()->GetString().GetLength();}')
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 696
697 fileHeadersPodofo.write('#endif // __DEFINED__SkPdfHeaders\n') 697 fileHeadersPodofo.write('#endif // __DEFINED__SkPdfHeaders\n')
698 698
699 fileHeadersPodofo.close() 699 fileHeadersPodofo.close()
700 fileHeadersPodofoCpp.close() 700 fileHeadersPodofoCpp.close()
701 701
702 if '__main__' == __name__: 702 if '__main__' == __name__:
703 #print sys.argv 703 #print sys.argv
704 sys.exit(generateCode()) 704 sys.exit(generateCode())
705 705
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698