aboutsummaryrefslogtreecommitdiff
path: root/Src/nde/android/IntegerField.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/nde/android/IntegerField.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/nde/android/IntegerField.h')
-rw-r--r--Src/nde/android/IntegerField.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/Src/nde/android/IntegerField.h b/Src/nde/android/IntegerField.h
new file mode 100644
index 00000000..d5729bb8
--- /dev/null
+++ b/Src/nde/android/IntegerField.h
@@ -0,0 +1,93 @@
+/* ---------------------------------------------------------------------------
+ Nullsoft Database Engine
+ --------------------
+ codename: Near Death Experience
+--------------------------------------------------------------------------- */
+
+/* ---------------------------------------------------------------------------
+
+ IntegerField Class Prototypes
+
+ Android (linux) implementation
+
+--------------------------------------------------------------------------- */
+
+#ifndef __INTEGERFIELD_H
+#define __INTEGERFIELD_H
+
+#include <foundation/types.h>
+
+class TimeParse {
+public:
+ int is_relative; // ago/after/before used
+ int absolute_datetime; // if not is_relative, this is the date/time, otherwise it's the resulting date/time if the query was ran now
+ int absolute_hasdate; // if not, use only the time portion of absolute_datetime, the rest is now
+ int absolute_hastime; // if not, use only the date portion of absolute_datetime, the rest is now
+ int relative_year; // -1 = this year
+ int relative_month; // -1 = this month
+ int relative_day; // -1 = this day, -2 = this week
+ int relative_hour; // -1 = this hour
+ int relative_min; // -1 = this minute
+ int relative_sec; // -1 = this second
+ int relative_kwday; // not used(-1), 0 to 6 for sunday to saturday, yesterday(7), today(8), tomorrow(9)
+ int offset_value; // timeago/offsetby numerical edit field
+ int offset_what; // not used(-1) years(0), months(1), weeks(2), days(3), hours(4), minutes(5), seconds(6)
+ int offset_whence; // not used(-1), after(0), ago/before(1)
+ int offset_used; // if 1, 'time ago' / 'offset by' should be checked
+};
+
+class IntegerField : public Field
+ {
+ protected:
+
+ virtual void ReadTypedData(const uint8_t *, size_t len);
+ virtual void WriteTypedData(uint8_t *, size_t len);
+ virtual size_t GetDataSize(void);
+ virtual int Compare(Field *Entry);
+ virtual bool ApplyFilter(Field *Data, int op);
+ void InitField(void);
+ int Value;
+
+ enum {
+ WHAT_YEARS,
+ WHAT_MONTHS,
+ WHAT_WEEKS,
+ WHAT_DAYS,
+ WHAT_HOURS,
+ WHAT_MINUTES,
+ WHAT_SECONDS,
+ };
+
+ enum {
+ FROM_BARE,
+ FROM_AGO,
+ FROM_SINCE,
+ };
+
+ public:
+
+ ~IntegerField();
+ IntegerField(int);
+ IntegerField();
+ int GetValue(void);
+ void SetValue(int);
+ int ApplyConversion(const char *format, TimeParse *tp=NULL);
+ static int LookupToken(const char *t);
+ };
+
+
+class DateTimeField : public IntegerField {
+ public:
+ DateTimeField();
+ DateTimeField(int Val);
+ virtual ~DateTimeField();
+};
+
+class LengthField : public IntegerField {
+ public:
+ LengthField();
+ LengthField(int Val);
+ virtual ~LengthField();
+};
+
+#endif \ No newline at end of file