Commit Graph

168 Commits

Author SHA1 Message Date
Bananymous be5b81740e BAN: Add enum class Iteration for for_each loops 2023-08-22 11:30:53 +03:00
Bananymous e7458ca10a BAN: Function call is now const 2023-08-22 11:30:40 +03:00
Bananymous 6feb8a99d2 BAN: UniqPtr can now be constructed from other convertible UniqPtr 2023-08-04 10:29:42 +03:00
Bananymous 5411c5aa4a BAN: Fix function call in Optional 2023-07-21 10:57:46 +03:00
Bananymous 891144dac1 BAN: Iterators are now single general type with CONST template
This allows us to use the same base class for iterator and
const_iterator which were practically the same code.
2023-07-12 13:35:21 +03:00
Bananymous 41e7b53903 BAN: add either_or and either_or_t
This allows you to select type depending on constexpr evaluatable
boolean
2023-07-12 13:34:31 +03:00
Bananymous 6b0920e8c0 BAN: Implement ConstIteratorDouble and add it to HashMap
This is same as IteratorDouble except it uses const_iterator and does
not return non-const references.
2023-07-12 11:41:05 +03:00
Bananymous 4285729d5c BAN: Generalize HashMapIterator to IteratorDouble
This iterator should be able to iterate any container within container
with type iterator defined.

This also fixed bug if first entry in outer container is empty container.
2023-07-12 09:29:05 +03:00
Bananymous 9174a89971 BAN: Add iterators to HashMap 2023-07-10 23:16:41 +03:00
Bananymous 74af46cb4a BAN: RefPtr can be constructed from other types 2023-07-10 11:48:11 +03:00
Bananymous c38e8de6b5 BAN: Optional can be constructed inplace 2023-06-12 23:45:36 +03:00
Bananymous 97638f7ade BAN: Add operator-> and operator* to Optional 2023-06-12 22:25:14 +03:00
Bananymous a0be415e09 BAN: Add basic Optional 2023-06-11 21:00:25 +03:00
Bananymous 6aff459e1c BAN: add StringView::contains(char) 2023-06-05 22:51:02 +03:00
Bananymous 413f05bfca BAN: Add UniqPtr 2023-06-04 00:39:20 +03:00
Bananymous 2ce244d303 BAN: Errors now includes assert.h 2023-06-03 18:53:05 +03:00
Bananymous feea2d4024 BAN: Fix function call in Vector 2023-06-01 00:50:04 +03:00
Bananymous cb359a05dc BuildSystem: link libraries when they change
This also fixed the need for manual linkin on firt build
2023-05-31 23:01:40 +03:00
Bananymous f79250c4d4 LibC: Rewrite all the headers.
We now have more or less posix issue 2018 conforming libc headers.

This was a really time consuming and boring operation but it had to
be done.

Now we get to actually start implementing libc :)
2023-05-26 22:31:21 +03:00
Bananymous 78b62776d2 BAN: libban is now build into library dir 2023-05-26 22:31:21 +03:00
Bananymous bda4614783 BAN: Errors.h can be included from userspace 2023-05-26 22:31:21 +03:00
Bananymous 632b699475 BAN: add is_arithmetic and is_signed to Traits.h 2023-05-15 20:26:29 +03:00
Bananymous 13fabcc1f1 BAN: add pow, log2, log10, log in math
These are implemented using x86 floating point assembly
2023-05-10 19:03:33 +03:00
Bananymous c2ad76fe4f BAN: Error uses 64 bit error codes 2023-05-07 02:09:52 +03:00
Bananymous 88a2c60065 BAN: Add is_power_of_two to Math functions 2023-04-28 14:42:49 +03:00
Bananymous c5b006bf19 BAN: Add {TRY,MUST}_REF for references
It is annoying that we have to have separate macros for these but
I can't find a way to cleanly return lvalue reference from statement
expression. Currently we cast the reference to pointer and return
unreference the pointer outside of the expression.

This feature will probably not be used any time soon, but atleas
it is implemented if I need it one day
2023-04-19 00:31:15 +03:00
Bananymous 115c44630d BAN: TRY and MUST macros use rvalue references 2023-04-19 00:11:15 +03:00
Bananymous 1dc81abca4 BAN: Add specialization for ErrorOr<LValueReference>
ErrorOr can now return a reference :)
2023-04-18 22:02:47 +03:00
Bananymous 5aaf2128a8 BAN: Variant with reference now supports copy/assign 2023-04-18 20:21:23 +03:00
Bananymous 6aeac17072 BAN: Variant now works with references
References can be assigned with the set() method. Construction nor
assigment operators cannot be used with references to avoid ambiguity
with what assignment to reference does.

You can set the underlying reference with the set() method and access
it with the get() method.

The references are stored as pointers to the object under the hood
which means that size of a reference is sizeof pointer.
2023-04-18 19:53:34 +03:00
Bananymous 6d425182a2 BAN: Variant::set now copy/move assigns when possible 2023-04-18 19:10:22 +03:00
Bananymous 04ac23b67c BAN: Variant now has variadic template types 2023-04-18 18:29:48 +03:00
Bananymous 9c0f3dd996 Kernel: Move kmalloc and MMU to Memory directory 2023-04-18 10:18:15 +03:00
Bananymous 0ee7da92a3 BAN: Variant now aligns its data properly 2023-04-12 00:17:45 +03:00
Bananymous 8d6db168d6 Kernel: remove message from BAN::Error
We don't store the error message anymore in BAN::Error.
Instead we store a error code that can be mapped into a string.
This allows BAN::Error to only take 4 bytes instead of 128.

We should also make some kernel initialization just panic instead
of returning errors since they are required for succesfull boot
anyway.
2023-04-11 23:25:21 +03:00
Bananymous 2fabe1949c BAN: Move RefPtr to its own file and create New.h
New.h contains definitions for placement new operators and
BAN::allocator and BAN::dealloctor
2023-04-10 21:07:25 +03:00
Bananymous c660df14ec BuildSystem: Fix header copying to sysroot
We used to copy all headers everytime to sysroot which caused
rebuild of the whole os. Now we use the cmake command
'copy_directory_if_different' which seemed to fix this issue :)
2023-04-10 21:07:25 +03:00
Bananymous 5db5ff069a BuildSystem: you can now build the toolchain with cmake 2023-04-06 00:23:02 +03:00
Bananymous de9f109f2a BAN: Add data() member function to Array 2023-04-03 17:00:52 +03:00
Bananymous e49d3c7bfe BuildSystem: We are now using cmake instead of plain make
I have been annoyed for a while since I had to build everything
when running the os since the buildsystem was really bad.

I wanted to rewrite the whole build system and changed to using cmake

:)
2023-04-02 04:07:27 +03:00
Bananymous c32584cca0 BAN: LinkedList::remove now returns iterator to the element after 2023-03-30 18:46:19 +03:00
Bananymous c1dbafc101 BAN: StringView::split(char, bool) is now thread safe
I had to duplicate some code, but this is better since I would like
to not use BAN::Function for something like this
2023-03-30 16:35:38 +03:00
Bananymous f9c3ae7090 BAN: String add front() and back() helpers 2023-03-29 14:10:29 +03:00
Bananymous 779912d8af BAN: Vector now takes optional argument for default value on resize 2023-03-28 23:10:36 +03:00
Bananymous f205b8e883 BAN: Implement basic Circular Queue 2023-03-28 21:44:02 +03:00
Bananymous 0ef318633c BAN: ScopeGuard can now be disabled (it wont call the function) 2023-03-28 01:15:13 +03:00
Bananymous 6d6bef1b04 BAN: move placement new declaration to Move.h 2023-03-27 03:38:06 +03:00
Bananymous f8a2c60c8d Kernel/BAN: move unix time conversion to BAN and add stat to Shell 2023-03-27 00:49:58 +03:00
Bananymous a063d041c9 BAN: char* is now formatted as string and not pointer 2023-03-23 14:29:35 +02:00
Bananymous 3572e9794a BAN: Modify Span constructors to keep constness correctly 2023-03-23 14:26:03 +02:00