Displaying 6 results from an estimated 6 matches for "swfdec_as_string_indexof".
2007 Aug 24
0
7 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_string.c test/trace
...decAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
{
- const char *string = swfdec_as_object_to_string (cx, object);
+ const char *string = swfdec_as_string_object_to_string (cx, object);
gsize len;
const char *s;
@@ -110,7 +123,7 @@ void
swfdec_as_string_indexOf (SwfdecAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
{
- const char *string = swfdec_as_object_to_string (cx, object);
+ const char *string = swfdec_as_string_object_to_string (cx, object);
int offset=0, len, i=-1;
const char *s, *t = NULL...
2007 Jun 28
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_as_strings.c test/trace
...12:34:31 2007 +0200
add String.indexOf()
diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c
index 5ce98c9..8515c7c 100644
--- a/libswfdec/swfdec_as_string.c
+++ b/libswfdec/swfdec_as_string.c
@@ -68,6 +68,30 @@ swfdec_as_str_nth_char (const char *s, g
}
static void
+swfdec_as_string_indexOf (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+ SwfdecAsString *string = SWFDEC_AS_STRING (object);
+ int offset=0, len, i=-1;
+ const char *s, *t = NULL;
+
+ s = swfdec_as_value_to_string (object->context, &argv[0]);
+ if (ar...
2007 Sep 02
0
libswfdec/swfdec_as_array.c libswfdec/swfdec_as_string.c
...swfdec_as_string_lastIndexOf (SwfdecAsCo
gsize len;
const char *s;
+ if (argc < 1)
+ return;
+
s = swfdec_as_value_to_string (object->context, &argv[0]);
if (argc == 2) {
int offset = swfdec_as_value_to_integer (object->context, &argv[1]);
@@ -127,6 +130,9 @@ swfdec_as_string_indexOf (SwfdecAsContex
int offset=0, len, i=-1;
const char *s, *t = NULL;
+ if (argc < 1)
+ return;
+
s = swfdec_as_value_to_string (object->context, &argv[0]);
if (argc == 2)
offset = swfdec_as_value_to_integer (object->context, &argv[1]);
@@ -152,6 +158,9 @@ swfde...
2007 Aug 21
0
4 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c test/trace
...C_AS_STR_constructor,
+ &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charAt, 1);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_indexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_indexOf, 1);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charCodeAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charCodeAt, 1);
diff --git a/libswfdec/swfdec_color_as.c b/libswfdec/swfdec_color_as.c
index 3abf5f9..06b7d5c 100644
--- a/libswfdec/swfdec_color_as.c
+++ b/libswfdec/swfdec_color_as.c
@@...
2007 Nov 14
0
9 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c libswfdec/swfdec_interval.c test/image test/trace
..._to_string (cx, &argv[0]);
if (argc == 2) {
- int offset = swfdec_as_value_to_integer (object->context, &argv[1]);
+ int offset = swfdec_as_value_to_integer (cx, &argv[1]);
if (offset < 0) {
SWFDEC_AS_VALUE_SET_INT (ret, -1);
return;
@@ -139,9 +139,9 @@ swfdec_as_string_indexOf (SwfdecAsContext *cx, SwfdecAsObject *object,
if (argc < 1)
return;
- s = swfdec_as_value_to_string (object->context, &argv[0]);
+ s = swfdec_as_value_to_string (cx, &argv[0]);
if (argc == 2)
- offset = swfdec_as_value_to_integer (object->context, &argv[1]);
+...
2007 Aug 23
0
23 commits - doc/.gitignore doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_keys.c libswfdec-gtk/swfdec_gtk_keys.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec/Makefile.am
...ing, offset + 1) - string->string;
+ } else {
+ len = G_MAXSIZE;
+ }
+ s = g_strrstr_len (string->string, len, s);
+ if (s) {
+ SWFDEC_AS_VALUE_SET_INT (ret, g_utf8_pointer_to_offset (string->string, s));
+ } else {
+ SWFDEC_AS_VALUE_SET_INT (ret, -1);
+ }
+}
+
+static void
swfdec_as_string_indexOf (SwfdecAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
{
@@ -262,7 +289,6 @@ charAt(index:Number) : String
charCodeAt(index:Number) : Number
concat(value:Object) : String
indexOf(value:String, [startIndex:Number]) : Number
-lastIndexOf(value:Stri...