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

Side by Side Diff: fpdfsdk/include/javascript/JS_Value.h

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. Created 5 years, 4 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
« no previous file with comments | « fpdfsdk/include/javascript/JS_Runtime.h ('k') | fpdfsdk/include/javascript/PublicMethods.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_
8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_
9 9
10 #include "../../../core/include/fxcrt/fx_basic.h" 10 #include "../../../core/include/fxcrt/fx_basic.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void operator = (float); 56 void operator = (float);
57 void operator = (CJS_Object*); 57 void operator = (CJS_Object*);
58 void operator = (CJS_Document*); 58 void operator = (CJS_Document*);
59 void operator = (v8::Local<v8::Object>); 59 void operator = (v8::Local<v8::Object>);
60 void operator = (CJS_Array &); 60 void operator = (CJS_Array &);
61 void operator = (CJS_Date &); 61 void operator = (CJS_Date &);
62 void operator = (const FX_WCHAR* pWstr); 62 void operator = (const FX_WCHAR* pWstr);
63 void operator = (const FX_CHAR* pStr); 63 void operator = (const FX_CHAR* pStr);
64 void operator = (CJS_Value value); 64 void operator = (CJS_Value value);
65 65
66 » FX_BOOL IsArrayObject() const; 66 » bool IsArrayObject() const;
67 » FX_BOOL»IsDateObject() const; 67 » bool» IsDateObject() const;
68 FXJSVALUETYPE GetType() const; 68 FXJSVALUETYPE GetType() const;
69 69
70 » FX_BOOL ConvertToArray(CJS_Array &) const; 70 » bool ConvertToArray(CJS_Array &) const;
71 » FX_BOOL ConvertToDate(CJS_Date &) const; 71 » bool ConvertToDate(CJS_Date &) const;
72 72
73 v8::Isolate* GetIsolate() {return m_isolate;} 73 v8::Isolate* GetIsolate() {return m_isolate;}
74 protected: 74 protected:
75 v8::Local<v8::Value> m_pValue; 75 v8::Local<v8::Value> m_pValue;
76 FXJSVALUETYPE m_eType; 76 FXJSVALUETYPE m_eType;
77 v8::Isolate* m_isolate; 77 v8::Isolate* m_isolate;
78 }; 78 };
79 79
80 class CJS_Parameters : public CFX_ArrayTemplate<CJS_Value> 80 class CJS_Parameters : public CFX_ArrayTemplate<CJS_Value>
81 { 81 {
82 public: 82 public:
83 void push_back(const CJS_Value& newElement) { 83 void push_back(const CJS_Value& newElement) {
84 CFX_ArrayTemplate<CJS_Value>::Add(newElement); 84 CFX_ArrayTemplate<CJS_Value>::Add(newElement);
85 } 85 }
86 int size() const { 86 int size() const {
87 return CFX_ArrayTemplate<CJS_Value>::GetSize(); 87 return CFX_ArrayTemplate<CJS_Value>::GetSize();
88 } 88 }
89 }; 89 };
90 90
91 class CJS_PropValue: public CJS_Value 91 class CJS_PropValue: public CJS_Value
92 { 92 {
93 public: 93 public:
94 CJS_PropValue(const CJS_Value&); 94 CJS_PropValue(const CJS_Value&);
95 CJS_PropValue(v8::Isolate* isolate); 95 CJS_PropValue(v8::Isolate* isolate);
96 ~CJS_PropValue(); 96 ~CJS_PropValue();
97 public: 97 public:
98 » FX_BOOL IsSetting(); 98 » bool IsSetting();
99 » FX_BOOL IsGetting(); 99 » bool IsGetting();
100 void operator<<(int); 100 void operator<<(int);
101 void operator>>(int&) const; 101 void operator>>(int&) const;
102 void operator<<(bool); 102 void operator<<(bool);
103 void operator>>(bool&) const; 103 void operator>>(bool&) const;
104 void operator<<(double); 104 void operator<<(double);
105 void operator>>(double&) const; 105 void operator>>(double&) const;
106 void operator<<(CJS_Object* pObj); 106 void operator<<(CJS_Object* pObj);
107 void operator>>(CJS_Object*& ppObj) const; 107 void operator>>(CJS_Object*& ppObj) const;
108 void operator<<(CJS_Document* pJsDoc); 108 void operator<<(CJS_Document* pJsDoc);
109 void operator>>(CJS_Document*& ppJsDoc) const; 109 void operator>>(CJS_Document*& ppJsDoc) const;
110 void operator<<(CFX_ByteString); 110 void operator<<(CFX_ByteString);
111 void operator>>(CFX_ByteString&) const; 111 void operator>>(CFX_ByteString&) const;
112 void operator<<(CFX_WideString); 112 void operator<<(CFX_WideString);
113 void operator>>(CFX_WideString&) const; 113 void operator>>(CFX_WideString&) const;
114 void operator<<(const FX_WCHAR* c_string); 114 void operator<<(const FX_WCHAR* c_string);
115 void operator<<(JSFXObject); 115 void operator<<(JSFXObject);
116 void operator>>(JSFXObject&) const; 116 void operator>>(JSFXObject&) const;
117 void operator>>(CJS_Array& array) const; 117 void operator>>(CJS_Array& array) const;
118 void operator<<(CJS_Array& array); 118 void operator<<(CJS_Array& array);
119 void operator<<(CJS_Date& date); 119 void operator<<(CJS_Date& date);
120 void operator>>(CJS_Date& date) const; 120 void operator>>(CJS_Date& date) const;
121 operator v8::Local<v8::Value>() const; 121 operator v8::Local<v8::Value>() const;
122 void StartSetting(); 122 void StartSetting();
123 void StartGetting(); 123 void StartGetting();
124 private: 124 private:
125 » FX_BOOL m_bIsSetting; 125 » bool m_bIsSetting;
126 }; 126 };
127 127
128 class CJS_Array 128 class CJS_Array
129 { 129 {
130 public: 130 public:
131 CJS_Array(v8::Isolate* isolate); 131 CJS_Array(v8::Isolate* isolate);
132 virtual ~CJS_Array(); 132 virtual ~CJS_Array();
133 133
134 void Attach(v8::Local<v8::Array> pArray); 134 void Attach(v8::Local<v8::Array> pArray);
135 void GetElement(unsigned index,CJS_Value &value); 135 void GetElement(unsigned index,CJS_Value &value);
136 void SetElement(unsigned index,CJS_Value value); 136 void SetElement(unsigned index,CJS_Value value);
137 int GetLength(); 137 int GetLength();
138 » FX_BOOL IsAttached(); 138 » bool IsAttached();
139 operator v8::Local<v8::Array>(); 139 operator v8::Local<v8::Array>();
140 140
141 v8::Isolate* GetIsolate() {return m_isolate;} 141 v8::Isolate* GetIsolate() {return m_isolate;}
142 private: 142 private:
143 v8::Local<v8::Array> m_pArray; 143 v8::Local<v8::Array> m_pArray;
144 v8::Isolate* m_isolate; 144 v8::Isolate* m_isolate;
145 }; 145 };
146 146
147 class CJS_Date 147 class CJS_Date
148 { 148 {
(...skipping 23 matching lines...) Expand all
172 int GetSeconds(); 172 int GetSeconds();
173 void SetSeconds(int seconds); 173 void SetSeconds(int seconds);
174 174
175 operator v8::Local<v8::Value>(); 175 operator v8::Local<v8::Value>();
176 operator double() const; 176 operator double() const;
177 177
178 CFX_WideString ToString() const; 178 CFX_WideString ToString() const;
179 179
180 static double MakeDate(int year, int mon, int mday,int hour, int min, int sec,int ms); 180 static double MakeDate(int year, int mon, int mday,int hour, int min, int sec,int ms);
181 181
182 » FX_BOOL»IsValidDate(); 182 » bool» IsValidDate();
183 183
184 protected: 184 protected:
185 v8::Local<v8::Value> m_pDate; 185 v8::Local<v8::Value> m_pDate;
186 v8::Isolate* m_isolate; 186 v8::Isolate* m_isolate;
187 }; 187 };
188 188
189 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ 189 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_
OLDNEW
« no previous file with comments | « fpdfsdk/include/javascript/JS_Runtime.h ('k') | fpdfsdk/include/javascript/PublicMethods.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698