Little utilities for more pleasant immutable data in Kotlin

Related tags

Utility kopykat
Overview

One of the great features of Kotlin data classes is their copy method. But using it can become cumbersome very quickly, because you need to repeat the name of the field before and after.

data class Person(val name: String, val age: Int)

val p1 = Person("Alex", 1)
val p2 = p1.copy(age = p1.age + 1)  // too many 'age'!

What can KopyKat do?

This plug-in generates a couple of new methods that make working with immutable (read-only) types, like data classes and value classes, more convenient.

IntelliJ showing the methods


Mutable copy

This new version of copy takes a block as a parameter. Within that block, mutability is simulated; the final assignment of each (mutable) variable becomes the value of the new copy. These are generated for both data classes and value classes.

val p1 = Person("Alex", 1)
val p2 = p1.copy { 
  age++
}

You can use old to access the previous (immutable) value, before any changes.

val p3 = p1.copy { 
  age++
  if (notTheirBirthday) {
    age = old.age  // get the previous value
  }
}

Nested mutation

If you have a data class that contains another data class (or value class) as a property, you can also make changes to inner types. Let's say we have these types:

data class Person(val name: String, val job: Job)
data class Job(val title: String, val teams: List<String>)

val p1 = Person(name = "John", job = Job("Developer", listOf("Kotlin", "Training")))

Currently, to do mutate inner types you have to do the following:

val p2 = p1.copy(job = p1.job.copy(title = "Señor Developer"))

With KopyKat you can do this in a more readable way:

val p2 = p1.copy { job.title = "Señor Developer" }

Warning For now, this doesn't work with types that are external to the source code (i.e. dependencies). We are working on supporting this in the future.

Nested collections

The nested mutation also extends to collections, which are turned into their mutable counterparts, if they exist.

val p3 = p1.copy { job.teams.add("Compiler") }

To avoid unnecessary copies, we recommend to mutate the collections in-place as much as possible. This means that forEach functions and mutation should be preferred over map.

val p4 = p1.copy { // needs an additional toMutableList at the end
  job.teams = job.teams.map { it.capitalize() }.toMutableList()
}
val p5 = p1.copy { // mutates the job.teams collection in-place
  job.teams.forEachIndexed { i, team -> job.teams[i] = team.capitalize() }
}

The at.kopyk:mutable-utils library (documentation) contains versions of the main collection functions which reuse the same structure.

val p6 = p1.copy { // mutates the job.teams collection in-place
  job.teams.mutateAll { it.capitalize() }
}

Mapping copyMap

Instead of new values, copyMap takes as arguments the transformations that ought to be applied to each argument. The "old" value of each field is given as argument to each of the functions, so you can refer to it using it or introduce an explicit name.

val p1 = Person("Alex", 1)
val p2 = p1.copyMap(age = { it + 1 })
val p3 = p1.copyMap(name = { nm -> nm.capitalize() })

The whole "old" value (the Person in the example above) is given as receiver to each of the transformations. That means that you can access all the other fields in the body of each of the transformations.

val p4 = p1.copyMap(age = { name.count() })

Note you can use copyMap to simulate copy, by making the transformation return a constant value.

val p5 = p1.copyMap(age = { 10 })

Note When using value classes, given that you only have one property, you can skip the name of the property.

@JvmInline value class Age(ageValue: Int)

val a = Age(39)

val b = a.copyMap { it + 1 }

copy for sealed hierarchies

KopyKat also works with sealed hierarchies. These are both sealed classes and sealed interfaces. It generates regular copy, copyMap, and mutable copy for the common properties, which ought to be declared in the parent class.

abstract sealed class User(open val name: String)
data class Person(override val name: String, val age: Int): User(name)
data class Company(override val name: String, val address: String): User(name)

This means that the following code works directly, without requiring an intermediate when.

fun User.takeOver() = this.copy { name = "Me" }

Equally, you can use copyMap in a similar fashion:

fun User.takeOver() = this.copyMap(name = { "Me" })

Or, you can use a more familiar copy function:

fun User.takeOver() = this.copy(name = "Me")

Warning KopyKat only generates these if all the subclasses are data or value classes. We can't mutate object types without breaking the world underneath them. And cause a lot of pain.


copy from supertypes

KopyKat generates "fake constructors" which consume a supertype of a data class, if that supertype defines all the properties required by its primary constructor. This is useful when working with separate domain and data transfer types.

data class Person(val name: String, val age: Int)
@Serializable data class RemotePerson(val name: String, val age: Int)

In that case you can define a common interface which represents the data,

interface PersonCommon {
  val name: String
  val age: Int
}

data class Person(override val name: String, override val age: Int): PersonCommon
@Serializable data class RemotePerson(override val name: String, override val age: Int): PersonCommon

With those "fake constructors" you can move easily from one to the other representation.

val p1 = Person("Alex", 1)
val p2 = RemotePerson(p1)

copy for type aliases

KopyKat can also generate the different copy methods for a type alias.

@CopyExtensions
typealias Person = Pair<String, Int>

// generates the following methods
fun Person.copyMap(first: (String) -> String, second: (Int) -> Int): Person = TODO()
fun Person.copy(block: `Person$Mutable`.() -> Unit): Person = TODO()

The following must hold for the type alias to be processed:

  • It must be marked with the @CopyExtensions annotation,
  • It must refer to a data or value class, or a type hierarchy of those.

Using KopyKat in your project

This demo project showcases the use of KopyKat alongside version catalogs.

KopyKat builds upon KSP, from which it inherits easy integration with Gradle. To use this plug-in, add the following in your build.gradle.kts:

  1. Add Maven Central to the list of repositories.

    repositories {
      mavenCentral()
    }
  2. Add KSP to the list of plug-ins. You can check the latest version in their releases.

    plugins {
      id("com.google.devtools.ksp") version "1.7.10-1.0.6"
    }
  3. Add a KSP dependency on KopyKat.

    dependencies {
      // other dependencies
      ksp("at.kopyk:kopykat-ksp:$kopyKatVersion")
    }
  4. (Optional) If you are using IntelliJ as your IDE, we recommend you to follow these steps to make it aware of the new code.

Enable only for selected types

By default, KopyKat generates methods for every data and value class, and sealed hierarchies of those. If you prefer to enable generation for only some classes, this is of course possible. Note that you always require a @CopyExtensions annotation to process a type alias.

All classes in given packages

Change the generate option for the plug-in, by passing options to KSP. The packages should be separated by :, and you can use wildcards, as supported by wildcardMatch.

ksp {
  arg("generate", "packages:my.example.*")
}

Using annotations

  1. Add a dependency to KopyKat's annotation package. Note that we declare it as compileOnly, which means there's no trace of it in the compiled artifact.

    dependencies {
      // other dependencies
      compileOnly("at.kopyk:kopykat-annotations:$kopyKatVersion")
    }
  2. Change the generate option for the plug-in, by passing options to KSP.

    ksp {
      arg("generate", "annotated")
    }
  3. Mark those classes you want KopyKat to process with the @CopyExtensions annotation.

    import at.kopyk.CopyExtensions
    
    @CopyExtensions data class Person(val name: String, val age: Int)

Customizing the generation

You can disable the generation of some of these methods by passing options to KSP in your Gradle file. For example, the following block disables the generation of copyMap.

ksp {
  arg("mutableCopy", "true")
  arg("copyMap", "false")
  arg("hierarchyCopy", "true")
  arg("superCopy", "true")
}

By default, the three kinds of methods are generated.


What about optics?

Optics, like the ones provided by Arrow, are a much more powerful abstraction. Apart from changing fields, optics allow uniform access to collections, possibly-null values, and hierarchies of data classes. You can even define a single copy function which works for every type, instead of relying on generating an implementation for each data type.

KopyKat, on the other hand, aims to be just a tiny step further from Kotlin's built-in copy. By re-using well-known idioms, the barrier to introducing this plug-in becomes much lower. Our goal is to make it easier to work with immutable data classes.

Comments
  • unable to  build with make on windows using 64bit mingw

    unable to build with make on windows using 64bit mingw

    unable to build with make on windows using 64bit mingw It fails 33% of way through on the algorithm target It is likely because its not linking with ws2_32 mswsock as in " -lws2_32 -lmswsock" Error follows

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Users\JWATERLOO>cd C:\Tutorials\C++\boost.http\build
    
    C:\Tutorials\C++\boost.http\build>mingw32-make
    [ 23%] Built target boost_http
    [ 28%] Linking CXX executable algorithm.exe
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x442
    ): undefined reference to `_imp__WSACleanup@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0xcba
    ): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_check
    pointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0xd78
    ): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERKN
    S0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS1
    _10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x11d
    9): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x129
    2): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x16f
    a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x17b
    8): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1d4
    a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1e0
    8): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x226
    9): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x232
    2): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x278
    a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x284
    8): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x2dd
    a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x2e9
    8): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x32f
    9): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x33b
    2): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x380
    a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x38c
    8): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x3e5
    a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x3f1
    8): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x44a
    a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x456
    8): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x4af
    a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x4bb
    8): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x515
    2): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x521
    0): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x57a
    2): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x586
    0): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x5df
    2): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x5eb
    0): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x644
    2): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x650
    0): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x6a9
    2): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x6b5
    0): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x70e
    2): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x71a
    0): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x752
    6): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x75d
    e): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0xd11
    6): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_chec
    kpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0xd1c
    e): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implERK
    NS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjNS
    1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x12c
    e6): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_che
    ckpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x12d
    9e): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implER
    KNS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjN
    S1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x188
    90): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_che
    ckpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x189
    0f): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implER
    KNS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjN
    S1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x196
    d0): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_che
    ckpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x197
    4f): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implER
    KNS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjN
    S1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1a8
    55): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_che
    ckpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1a8
    ed): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implER
    KNS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjN
    S1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1bc
    e8): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_che
    ckpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1bd
    b3): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implER
    KNS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjN
    S1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1c6
    56): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_che
    ckpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1c8
    7d): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implER
    KNS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjN
    S1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1e7
    04): undefined reference to `_imp__WSACleanup@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1f3
    d4): undefined reference to `_imp__WSAStartup@8'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1f6
    57): undefined reference to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1f6
    a1): undefined reference to `_imp__WSASend@28'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1f6
    b1): undefined reference to `_imp__WSAGetLastError@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x1f9
    f8): undefined reference to `_imp__WSACleanup@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x209
    8a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_che
    ckpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x20a
    2f): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implER
    KNS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjN
    S1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x210
    7a): undefined reference to `_imp___ZN5boost9unit_test15unit_test_log_t14set_che
    ckpointENS0_13basic_cstringIKcEEjS4_'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text+0x211
    0c): undefined reference to `_imp___ZN5boost10test_tools9tt_detail10check_implER
    KNS0_16predicate_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEjN
    S1_10tool_levelENS1_10check_typeEjz'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13ba
    sic_cstringIKcEE[__ZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_d
    etail6unusedEEENS0_13basic_cstringIKcEE]+0x1f): undefined reference to `_imp___Z
    N5boost9unit_test9ut_detail24normalize_test_case_nameB5cxx11ENS0_13basic_cstring
    IKcEE'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13ba
    sic_cstringIKcEE[__ZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_d
    etail6unusedEEENS0_13basic_cstringIKcEE]+0x4b): undefined reference to `_imp___Z
    N5boost9unit_test9test_caseC1ENS0_13basic_cstringIKcEERKNS0_9callback0INS0_9ut_d
    etail6unusedEEE'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text.start
    up+0x25): undefined reference to `_imp___ZN5boost9unit_test14unit_test_mainEPFbv
    EiPPc'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text.start
    up+0xfb): undefined reference to `_imp___ZN5boost9unit_test9ut_detail24auto_test
    _unit_registrarC1EPNS0_9test_caseEm'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text.start
    up+0x904): undefined reference to `_imp___ZTVN5boost9unit_test15unit_test_log_tE
    '
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text.start
    up+0x93a): undefined reference to `_imp__WSAStartup@8'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio10io_serviceD1Ev[__ZN5boost4asio10io_serviceD1Ev]+0x77): undefined refe
    rence to `_imp__WSACleanup@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail10socket_ops5closeEjRhbRNS_6system10error_codeE[__ZN5boost4asio6
    detail10socket_ops5closeEjRhbRNS_6system10error_codeE]+0x1a): undefined referenc
    e to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail10socket_ops5closeEjRhbRNS_6system10error_codeE[__ZN5boost4asio6
    detail10socket_ops5closeEjRhbRNS_6system10error_codeE]+0x20): undefined referenc
    e to `_imp__WSAGetLastError@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail10socket_ops5closeEjRhbRNS_6system10error_codeE[__ZN5boost4asio6
    detail10socket_ops5closeEjRhbRNS_6system10error_codeE]+0x3a): undefined referenc
    e to `_imp__closesocket@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail10socket_ops5closeEjRhbRNS_6system10error_codeE[__ZN5boost4asio6
    detail10socket_ops5closeEjRhbRNS_6system10error_codeE]+0xd8): undefined referenc
    e to `_imp__setsockopt@20'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail10socket_ops5closeEjRhbRNS_6system10error_codeE[__ZN5boost4asio6
    detail10socket_ops5closeEjRhbRNS_6system10error_codeE]+0x14e): undefined referen
    ce to `_imp__ioctlsocket@12'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail28win_iocp_socket_service_base13start_send_opERNS2_24base_implem
    entation_typeEP7_WSABUFjibPNS1_18win_iocp_operationE[__ZN5boost4asio6detail28win
    _iocp_socket_service_base13start_send_opERNS2_24base_implementation_typeEP7_WSAB
    UFjibPNS1_18win_iocp_operationE]+0x69): undefined reference to `_imp__WSASend@28
    '
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail28win_iocp_socket_service_base13start_send_opERNS2_24base_implem
    entation_typeEP7_WSABUFjibPNS1_18win_iocp_operationE[__ZN5boost4asio6detail28win
    _iocp_socket_service_base13start_send_opERNS2_24base_implementation_typeEP7_WSAB
    UFjibPNS1_18win_iocp_operationE]+0x74): undefined reference to `_imp__WSAGetLast
    Error@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail14select_reactor21deregister_descriptorEjRNS2_19per_descriptor_d
    ataEb[__ZN5boost4asio6detail14select_reactor21deregister_descriptorEjRNS2_19per_
    descriptor_dataEb]+0x24f): undefined reference to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail14select_reactor21deregister_descriptorEjRNS2_19per_descriptor_d
    ataEb[__ZN5boost4asio6detail14select_reactor21deregister_descriptorEjRNS2_19per_
    descriptor_dataEb]+0x290): undefined reference to `_imp__WSASend@28'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio6detail14select_reactor21deregister_descriptorEjRNS2_19per_descriptor_d
    ataEb[__ZN5boost4asio6detail14select_reactor21deregister_descriptorEjRNS2_19per_
    descriptor_dataEb]+0x2a0): undefined reference to `_imp__WSAGetLastError@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x291): undefined r
    eference to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x296): undefined r
    eference to `_imp__closesocket@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x2b1): undefined r
    eference to `_imp__WSAGetLastError@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x36f): undefined r
    eference to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x3b0): undefined r
    eference to `_imp__WSASend@28'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x3c0): undefined r
    eference to `_imp__WSAGetLastError@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x4f3): undefined r
    eference to `_imp__ioctlsocket@12'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x50a): undefined r
    eference to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x551): undefined r
    eference to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x57c): undefined r
    eference to `_imp__setsockopt@20'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv[__ZN5boost4as
    io21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv]+0x58c): undefined r
    eference to `_imp__WSAGetLastError@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4http12basic_socketINS_4asio19basic_stream_socketINS2_2ip3tcpENS2_21stream_s
    ocket_serviceIS5_EEEEED1Ev[__ZN5boost4http12basic_socketINS_4asio19basic_stream_
    socketINS2_2ip3tcpENS2_21stream_socket_serviceIS5_EEEEED1Ev]+0x3b6): undefined r
    eference to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4http12basic_socketINS_4asio19basic_stream_socketINS2_2ip3tcpENS2_21stream_s
    ocket_serviceIS5_EEEEED1Ev[__ZN5boost4http12basic_socketINS_4asio19basic_stream_
    socketINS2_2ip3tcpENS2_21stream_socket_serviceIS5_EEEEED1Ev]+0x3f7): undefined r
    eference to `_imp__WSASend@28'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4http12basic_socketINS_4asio19basic_stream_socketINS2_2ip3tcpENS2_21stream_s
    ocket_serviceIS5_EEEEED1Ev[__ZN5boost4http12basic_socketINS_4asio19basic_stream_
    socketINS2_2ip3tcpENS2_21stream_socket_serviceIS5_EEEEED1Ev]+0x407): undefined r
    eference to `_imp__WSAGetLastError@0'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio15basic_io_objectINS0_21stream_socket_serviceINS0_2ip3tcpEEELb1EED2Ev[_
    _ZN5boost4asio15basic_io_objectINS0_21stream_socket_serviceINS0_2ip3tcpEEELb1EED
    2Ev]+0x366): undefined reference to `_imp__WSASetLastError@4'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio15basic_io_objectINS0_21stream_socket_serviceINS0_2ip3tcpEEELb1EED2Ev[_
    _ZN5boost4asio15basic_io_objectINS0_21stream_socket_serviceINS0_2ip3tcpEEELb1EED
    2Ev]+0x3a7): undefined reference to `_imp__WSASend@28'
    CMakeFiles\algorithm.dir/objects.a(algorithm.cpp.obj):algorithm.cpp:(.text$_ZN5b
    oost4asio15basic_io_objectINS0_21stream_socket_serviceINS0_2ip3tcpEEELb1EED2Ev[_
    _ZN5boost4asio15basic_io_objectINS0_21stream_socket_serviceINS0_2ip3tcpEEELb1EED
    2Ev]+0x3b7): undefined reference to `_imp__WSAGetLastError@0'
    ../libboost_http.a(socket.cpp.obj):socket.cpp:(.text+0x52): undefined reference
    to `_imp__WSACleanup@0'
    ../libboost_http.a(socket.cpp.obj):socket.cpp:(.text+0x81): undefined reference
    to `_imp__WSAStartup@8'
    collect2.exe: error: ld returned 1 exit status
    test\CMakeFiles\algorithm.dir\build.make:103: recipe for target 'test/algorithm.
    exe' failed
    mingw32-make[2]: *** [test/algorithm.exe] Error 1
    CMakeFiles\Makefile2:1079: recipe for target 'test/CMakeFiles/algorithm.dir/all'
     failed
    mingw32-make[1]: *** [test/CMakeFiles/algorithm.dir/all] Error 2
    makefile:137: recipe for target 'all' failed
    mingw32-make: *** [all] Error 2
    
    C:\Tutorials\C++\boost.http\build>
    
    bug 
    opened by jwaterloo 9
  • very interesting

    very interesting

    I believe this would be interesting to many people. Consider adding this to the Boost Library Incubator (www.blincubator.com) To do this, all you'd have to do is make a couple minor adjustments in directory layout and provide browsable html documentation.

    Robert Ramey

    opened by robertramey 5
  • Excessive writes for response headers

    Excessive writes for response headers

    Running a unit-test, I noticed that for every header, the header name and the header value as well as the \r\n at the end would result in three separate writes. This means three Kernel-Space/User-Space switches for each single header.

    opened by xvjau 3
  • Changed the read buffer to be internal

    Changed the read buffer to be internal

    The read buffer has been made internal to http::socket, partly for convenience, and partly to remove a potential source of error (e.g. the user could pass the same buffer to several sockets.)

    The buffer size was 4 in the examples, but I have increased this to 256 to avoid too many calls to async_read_some() but the number 256 is an arbitrary choice.

    opened by breese 2
  • Inlining reader::request::value() to avoid redefinition

    Inlining reader::request::value() to avoid redefinition

    If boost::http::buffered_socket was being used as member of a class implemented in a .cpp, for instance, the linker complained about redefinition in the file including the header of the class and in the object resulting of compilation of the class itself.

    opened by tarc 2
  • Enable OS X under Travis

    Enable OS X under Travis

    I already got permission, but it isn't enabled yet.

    opened by vinipsmaker 2
  • using  template<typename Handler> instead of boost::function

    using template instead of boost::function

    and make the library header only.

    opened by microcai 2
  • Update appveyor.yml

    Update appveyor.yml

    Use newer Visual Studio 2015 Update 1

    opened by vinipsmaker 1
  • Fixed ODR violations

    Fixed ODR violations

    opened by xvjau 1
  • Compile error, Visual Studio

    Compile error, Visual Studio

    I ran CMake on the test directory, opened up the solution, and tried to build. I get this error in many places:

    2>D:\lib\boost_1_61_0\boost/asio/detail/socket_types.hpp(24): fatal error C1189: #error: WinSock.h has already been included

    opened by vinniefalco 1
  • Add <boost/iostreams/filter/gzip.hpp> support

    Add support

    A basic feature of most HTTP request is the use of compression of post and response bodies. We need to implement some way of performing gzip compression and decompression.

    Ideally, allow for custom compressors to be used also.

    opened by xvjau 0
  • Limit the size of requests

    Limit the size of requests

    As a security measure, we need to limit the amount of bytes per request, so an attacker cannot, easily, perform a DoS attack by simply sending and excessive number of headers or multiple-gigabyte requests.

    Ideally, a preset limit in the number of HTTP-Headers that the parser will receive before dropping the request can be implemented. The user could optionally pass a custom limit when instantiating the template.

    opened by xvjau 1
  • Port to Boost.Beast?

    Port to Boost.Beast?

    Any plans to port this project to use Boost.Beast?

    opened by vinniefalco 1
  • Add a test to ODR violations

    Add a test to ODR violations

    It'll prevent this issue from reappearing: https://github.com/BoostGSoC14/boost.http/pull/44

    opened by vinipsmaker 0
  • `

    `"Content-Range"` mini-parser

    enhancement 
    opened by vinipsmaker 0
  • SSL Handshake Timeout

    SSL Handshake Timeout

    SSL handshake timeout should be configurable.

    opened by avalchev 7
  • Connection Read Timeout

    Connection Read Timeout

    I don't see how to specify how long server should wait to read the message from client's socket.

    Not sure if this is possible.

    opened by avalchev 2
  • Specify max header and URL in request line lengths

    Specify max header and URL in request line lengths

    I think that good security enhancement would be some max lengths configurations:

    • maximum length of URL in request line
    • maximum length of header's name and header's value

    These are possible attack surfaces.

    opened by avalchev 6
  • Change algorithms to take predicate by value

    Change algorithms to take predicate by value

    This change will allow predicates with non-const methods like the following one:

    struct P
    {
      bool operator()(boost::string_ref /*v*/)
      {
        ++c;
      }
      unsigned c = 0;
    }
    

    Also, it's the approach used by std::*'s algorithms.

    TODO

    • [ ] http://boostgsoc14.github.io/boost.http/reference/header_value_all_of.html
    • [ ] http://boostgsoc14.github.io/boost.http/reference/header_value_any_of.html
    • [ ] http://boostgsoc14.github.io/boost.http/reference/header_value_none_of.html
    enhancement 
    opened by vinipsmaker 0
  • HTTP client side

    HTTP client side

    TODO, research:

    • cURL
    • PHP's file_get_contents
    • serf
    • urllib3
    • Node.JS
    • Qt's network classes
    • JavaScript/HTML5
    • Firefox source code
    • Chromium source code
    • ruby-httpclient
    • python's requests
    • http://www.webdav.org/neon/
    • libsoup
    opened by vinipsmaker 6
Owner
KopyKat
Little utilities for more pleasant immutable data in Kotlin
KopyKat
Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

Shahid Iqbal 4 Nov 29, 2022
Collection of source codes, utilities, templates and snippets for Android development.

Android Templates and Utilities [DEPRECATED] Android Templates and Utilities are deprecated. I started with this project in 2012. Android ecosystem ha

Petr Nohejl 1.1k Nov 30, 2022
General purpose utilities and hash functions for Android and Java (aka java-common)

Essentials Essentials are a collection of general-purpose classes we found useful in many occasions. Beats standard Java API performance, e.g. LongHas

Markus Junginger 1.4k Dec 29, 2022
Utilities I wish Android had but doesn't

wishlist Library of helpers and utilities that I wish were included in the Android SDK but aren't. If you think something in this library is already h

Kevin Sawicki 386 Nov 21, 2022
Various useful utilities for Android apps development

Android Commons Various useful utilities for Android apps development. API documentation provided as Javadoc. Usage Add dependency to your build.gradl

Alex Vasilkov 112 Nov 14, 2022
Android library that regroup bunch of dateTime utilities

DateTimeUtils This library is a package of functions that let you manipulate objects and or java date string. it combine the most common functions use

Thunder413 98 Nov 16, 2022
General purpose utilities and hash functions for Android and Java (aka java-common)

Essentials Essentials are a collection of general-purpose classes we found useful in many occasions. Beats standard Java API performance, e.g. LongHas

Markus Junginger 1.4k Dec 29, 2022
A Telegram bot utilities that help to reduce the code amount

Flume Party A Telegram bot utilities that help to reduce code amount. Real project examples Pull Party Bot: 19% of code has been reduced. Resistance B

pool party 1 Jun 8, 2022
FractalUtils - A collection of utility functions and classes, with an emphasis on game related utilities

A collection of utility functions and classes written in Kotlin. There is some emphasis on utilities useful for games (Geometry, Random, Time, Updating, etc).

null 2 Nov 11, 2022
CreditCardHelper 🖊️ A Jetpack-Compose library providing useful credit card utilities such as card type recognition and TextField ViewTransformations

CreditCardHelper ??️ A Jetpack-Compose library providing useful credit card utilities such as card type recognition and TextField ViewTransformations

Stelios Papamichail 18 Dec 19, 2022
KmmCaching - An application that illustrates fetching data from remote data source and caching it in local storage

An application that illustrates fetching data from remote data source and caching it in local storage for both IOS and Android platforms using Kotlin Multiplatform Mobile and SqlDelight.

Felix Kariuki 5 Oct 6, 2022
Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure.

Secure-preferences - Deprecated Please use EncryptedSharedPreferences from androidx.security in preferenced to secure-preference. (There are no active

Scott Alexander-Bown 1.5k Dec 24, 2022
Create a simple and more understandable Android logs.

DebugLog Create a simple and more understandable Android logs. #Why? android.util.Log is the most usable library of the Android. But, when the app rel

mf 418 Nov 25, 2022
Fork of svg-android +SVN history +Maven +more

Status: Unmaintained. Discontinued. This project is no longer being developed or maintained. _ This is forked from the awesome but unmaintained: http:

David Barri 557 Dec 9, 2022
Simple Keyboard can adjustable keyboard height for more screen space

Simple Keyboard About Features: Small size (<1MB) Adjustable keyboard height for more screen space Number row Swipe space to move pointer Delete swipe

Raimondas Rimkus 681 Dec 27, 2022
📭 Extension to Ktor’s routing system to add object oriented routing and much more. 💜

?? Ktor Routing Extensions Extension to Ktor’s routing system to add object-oriented routing and much more. ?? Why? This extension library was created

Noelware 6 Dec 28, 2022
A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML

A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion.

null 603 Jan 1, 2023
Access and process various types of personal data in Android with a set of easy, uniform, and privacy-friendly APIs.

PrivacyStreams PrivacyStreams is an Android library for easy and privacy-friendly personal data access and processing. It offers a functional programm

null 269 Dec 1, 2022
A simple Android utils library to write any type of data into cache files and read them later.

CacheUtilsLibrary This is a simple Android utils library to write any type of data into cache files and then read them later, using Gson to serialize

Wesley Lin 134 Nov 25, 2022